title: UITextView in InputAccessoryView not becoming First Responder (Keyboard does not show up initially)
body: <p>I'm trying to implement an input accessory view that works just like Messages app in iOS. I've searched almost every SO questions regarding this topic, but couldn't find the solution that worked for me.</p>
  <p>Here is the minimal reproducible code I created, referring to this <a href="https://stackoverflow.com/questions/20108162/make-uitextview-parent-be-its-own-inputaccessoryview">SO post</a>.</p>
  <pre class="lang-swift prettyprint-override"><code>import UIKit
  
  class TestViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          view.backgroundColor = .white
          becomeFirstResponder()  // seems unnecessary
      }
      
      override var inputAccessoryView: UIToolbar {
          return self.keyboardAccessory
      }
      
      override var canBecomeFirstResponder: Bool {
          return true
      }
  
      var textView: UITextView = {
          let view = UITextView()
          view.translatesAutoresizingMaskIntoConstraints = false
          view.backgroundColor = .yellow
          return view
      }()
      
      lazy var keyboardAccessory: UIToolbar = {
          let inputAccessory = UIToolbar(frame: .init(x: 0, y: 0, width: 0, height: 100))
          inputAccessory.addSubview(textView)
          NSLayoutConstraint.activate([
              textView.centerXAnchor.constraint(equalTo: inputAccessory.centerXAnchor),
              textView.centerYAnchor.constraint(equalTo: inputAccessory.centerYAnchor),
              textView.widthAnchor.constraint(equalToConstant: 200),
              textView.heightAnchor.constraint(equalToConstant: 50)
          ])
          inputAccessory.backgroundColor = .gray
          return inputAccessory
      }()
  }
  </code></pre>
  <p>Every article I've seen suggests overriding <code>inputAccessoryView</code> and <code>canBecomeFirstResponder</code>, and that's it. However, the keyboard does not appear until I tap the <code>textView</code>.</p>
  <p>Can anyone let me know what I'm missing?</p>
  <h2>Edit</h2>
  <p>As @DonMag pointed out, Messages app in iOS does not show keyboard automatically. Please consider following UI in Facebook instead.</p>
  <p>When I press the comment button, it pushes to another view controller while popping up the keyboard. The transition effect doesn't have to be exactly the same, but I want the keyboard become fully loaded within presented view controller, as if I called <code>becomeFirstResponder()</code> in <code>viewDidLoad</code>.</p>
  <p><a href="https://i.stack.imgur.com/sav7w.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sav7w.gif" alt="enter image description here" /></a></p>