Disable TextFields Then Enable Them

is there a way to type into a textField while having the other textFields disabled but then after you type into that textField having those other textFields you disabled enabled again?


I know how to disable them with .isUserInteractionEnabled but I don't know how to enable them again with func textFieldShouldReturn.

Answered by Claude31 in 650795022

With my textFields there is an option to clear and I don't want them editing the other textField when they don't fill in the one they cleared.

That's new information. It comes piece by piece !

Implement similar code in
Code Block
optional func textFieldShouldClear(_ textField: UITextField) -> Bool

Code Block
if widthPer == textField {
heightPer.isUserInteractionEnabled = false
widthPer.isUserInteractionEnabled = true
} else {
heightPer.isUserInteractionEnabled = true
widthPer.isUserInteractionEnabled = false
}


If that works, don't forget to close the thread on this answer.

This is the code I have

Sorry, but it is not enough to solve your issue.
Thank you for your patience still have a lot to learn.
Disable TextFields Then Enable Them
 
 
Q