title: UITextField in UITableViewCell and becomeFirstResponder on selected cell keyboard show/hide glitch
body: <p>I have such view hierarchy:</p>
  
  <blockquote>
    <p>View Controller </p>
    
    <blockquote>
      <p>UITableView </p>
      
      <blockquote>
        <p>UITableViewCell</p>
        
        <blockquote>
          <p>UITextField</p>
        </blockquote>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>I have in my custom <code>UITableViewCell</code> a <code>textField</code> and my plan is to make this <code>textField</code> becomeFirstResponder as soon as user tap on cell. The first problem is that <code>textField</code> is getting touches events and cell is not selected because of that so when user tap right onto the <code>textField</code> then cell is not selected and I'm not able to update selected cell UI. I though that I can make <code>isUserInteractionEnabled=false</code> on <code>textField</code> so after user taps on <code>textField</code> I will have proper selection behavior in my cells. So far so good. Now I want to handle this selection in <code>setSelected</code> method in my custom cell. The problem is that if keyboard is already on screen and I execute <code>becomeFirstResponder()</code> on <code>textField</code> then the keyboard is hiding and immediately showing again. Normally I expect that this keyboard will stay on its place without trying to hide and show again. Here is the code:</p>
  
  <pre><code>class StringFieldTableViewCell: UITableViewCell {
  
      @IBOutlet weak var pinLine: UIView!
      @IBOutlet weak var pinLineFocused: UIView!
      @IBOutlet weak var textField: UITextField!
  
  
      override func awakeFromNib() {
          super.awakeFromNib()
          self.selectionStyle = .none
          self.textField.isUserInteractionEnabled = false
      }
  
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
          self.textField.isUserInteractionEnabled = selected
          if selected {
              self.textField.becomeFirstResponder()
          }
          self.pinLine.isHidden = selected
          self.pinLineFocused.isHidden = !selected
      }
  }
  </code></pre>
  
  <p>Does anybody knows how to fix this keyboard showing/hiding problem and why keyboard tries first to hide itself and then show in very short time?</p>