title: how to get the value of textfield in a UICollectionViewCell
body: <p>I have a two class. Whenever I get the value of the textfield it prints nothing and if I get rid of unwrap symbol it prints optional(""). How can I solve this?</p>
  
  <p>This is my code:</p>
  
  <pre><code>class userRegistration: UIViewController, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource {
      // in faction cell for item at index path i have this code
      function collectionView(..){
          let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellid", for: indexPath) as! registerNewUser
  
          cell.registerButton.addTarget(self, action: #selector(click), for: .touchUpInside)
  
          return cell
      }
  
      @objc func click()        
      {
          let object = registerNewUser()
          let email = object.newEmailTextField.text!
  
          print(email)
      }
  }
  </code></pre>
  
  <p>This is done programmatically and in Swift 4.</p>