title: Disable editing of a text field
body: <p>I want to start by saying this is my first project and I am trying hard to find answers myself before posting here. I thought I had found the code to accomplish this. I have no errors but when I run, the field is still editable. So, how can I disable editing of my field when the rule I have set is true?</p>
  
  <pre><code>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
      }
  </code></pre>
  
  <p>I have defined the array previously so the if statement is true. Thank you for you assistance.</p>