I want to start with the fact that this is my first project, and I try to find the answers myself before publishing here. I thought I found code for this. I have no errors, but when I run, the field is still editable. So, how can I turn off editing my field when the rule I set is correct?
if sport.count == 1 { enterSport.text = sport[0] as String //need to convert to a string enterSport.editing; false //do not allow editing } else { //do nothing }
I predefined an array, so the if statement is true. Thank you for your help.
source share