Is ther a way to make a UItextfield uneditable ?
How do you make a text field Uneditable in Swift? Within code: textfield. enable = false.
editing is a readonly property. You can't set it. If it's a UITextView, it has an editable property which you can set to false. Save this answer.
Swift's Text views represent static, unselectable text by default, but you can change that using the . textSelection() modifier with the . enabled value. When text is selected, the user automatically gains access to the regular text actions such as Copy and Share.
Pure SwiftUI (iOS 15) To dismiss the keyboard, simply set view's focusedField to nil . The return key will dismiss keyboard automatically (since iOS 14).
[theTextField setEnabled: NO];
Set the userInteractionEnabled
property to NO
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With