forked from shadowfacts/Tusker
Fix crash when opening Compose screen on iOS 13
This commit is contained in:
parent
262aadf807
commit
ec2d510be2
|
@ -145,8 +145,10 @@ struct MainComposeWrappedTextView: UIViewRepresentable {
|
||||||
context.coordinator.uiState = uiState
|
context.coordinator.uiState = uiState
|
||||||
|
|
||||||
if becomeFirstResponder {
|
if becomeFirstResponder {
|
||||||
uiView.becomeFirstResponder()
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
|
// calling becomeFirstResponder during the SwiftUI update causes a crash on iOS 13
|
||||||
|
uiView.becomeFirstResponder()
|
||||||
|
// can't update @State vars during the SwiftUI update
|
||||||
becomeFirstResponder = false
|
becomeFirstResponder = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue