title: shouldChangeCharactersIn range function not being called
body: <p>The code below works fine when I have used it with a view controller, though my current view controller has a header and text fields are in their and it doesn't bring up an error in the code though it has no effect; the function is never called?</p>
  
  <p>Here is the code - first put the func in class ProfileEditor</p>
  
  <pre><code>class ProfileEditor: UICollectionViewController, UICollectionViewDelegateFlowLayout, ProfileEditorHeaderDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
  
  func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool {
  
      print("text field func called")
  
      let currentCharacterCount = textField.text?.characters.count ?? 0
  
      if (range.length + range.location &gt; currentCharacterCount){
          return false
      }
      let newLength = currentCharacterCount + string.characters.count - range.length
      var maxLength = 0
      if textField.isEqual(header.displayNameTextFeild) {
          maxLength = 13
  
      return newLength &lt;= maxLength 
  }
  </code></pre>
  
  <p>then I put the func in the delegate</p>
  
  <pre><code> protocol ProfileEditorHeaderDelegate {
  
      func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -&gt; Bool
  
   }
  
   class ProfileHeaderEditor: UICollectionViewCell {
  
      let displayNameTextField: UITextField = {
         let tf = UITextField()
         tf.placeholder = "Display name"
         tf.font?.withSize(10)
         tf.backgroundColor = UIColor.white
         tf.textColor = UIColor.black
         tf.borderStyle = .roundedRect
  
         return tf
      }()
  }
  </code></pre>