我已经实现了UITextFieldDelegate并将isUserInteractionEnabled设置为true,但是textField仍然不可编辑,有一些建议吗?
lazy var myTextField: UITextField = {
let text = UITextField()
text.translatesAutoresizingMaskIntoConstraints = false
text.isUserInteractionEnabled = true
text.backgroundColor = .white
text.textColor = .black
text.borderStyle = .line
text.placeholder = "Enter your text"
return text
}()
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
return true
}