I noticed that a very basic code would produce a consistent console assert while editing almost every time keyboard long press is used (e.g. long pressing a letter would bring up a list of alternatives, like u, ü, etc).
text
2021-04-02 17:37:33.170756-0700 test[4255:2036410] [Assert] View (null):0x0 does not conform to UITextInput protocol
Simplified code:
swift
import UIKit
class ViewController: UIViewController {
var textField : UITextField!
override func loadView() {
textField = UITextField()
textField.text = "test"
textField.frame = CGRect(x: 100, y: 100, width: 100, height: 20)
let view = UIView()
view.backgroundColor = .white
view.frame = CGRect(x: 100, y: 100, width: 100, height: 20)
view.addSubview(textField)
self.view = view
}
}
Details: running on physical device iPhone 11 Pro iOS 14.4.2 (18D70) keyboard seems to be standard
also reproducible on simulator: iPhone 11 Pro, iOS 14.4 (18D46)
but not happening on simulator: iPhone 11 Pro, iOS 13.7 (17H22)
similar SwiftUI-based code also has the same issue
Seems like a regression to me, but I'm also open to possibility of something being wrong with my specific configuration (code or otherwise).
Questions:
is anyone else experiencing the same issue?
any workarounds / fixes?