I have question about wrapping custom UIViewControllers into SwiftUI view using UIViewControllerRepresentable. Does anyone have issue with UITextFields in such case? I have situation that sometimes this textfield works normally when wrapped and otherwise they just work for a while and stopped working after editinig text for about 10sec or hiding/showing keyboard, or they doesn't work at all. Situation seems to be very odd.
Asked
Active
Viewed 209 times
0
-
No, add your code. – mahan Aug 16 '21 at 13:08
-
It is too many code that can cause this issue it happans randomly both then i present viewcontrollers from root or when i wrap it into uiviewcontroller representable. Some screens works ok other just dosen't work, yet another work for a while and stopped working on second keyboard appearance. Very odd situation. I think I will need to investigate it myself as pasting entire app here is pointless. – Michał Ziobro Aug 17 '21 at 07:13
1 Answers
0
Ok it was the problem with
override var canBecomeFirstResponder: Bool { true }
on UIViewController
https://developer.apple.com/documentation/uikit/uiresponder/1621130-canbecomefirstresponder

Michał Ziobro
- 10,759
- 11
- 88
- 143