title: Keyboard hide UITextView swift 2
body: <p>I m using <code>UITableView</code> with 2 customs cells, I have custom cells with <code>UITextView</code> and <code>UITextField</code>, I'm trying to move up the edited field when it's hiding by the keyboard on the top of the keyboard, here is my code for the <code>viewDidLoad</code> :</p>
  
  <pre><code> override func viewDidLoad() {
          super.viewDidLoad()
   let notificationCenter = NSNotificationCenter.defaultCenter()
          notificationCenter.addObserver(self, selector: #selector(adjustForKeyboard), name: UIKeyboardWillShowNotification, object: nil)
          notificationCenter.addObserver(self, selector: #selector(adjustForKeyboard), name: UIKeyboardWillHideNotification, object: nil)
          notificationCenter.addObserver(self, selector: #selector(adjustForKeyboard), name: UIKeyboardWillChangeFrameNotification, object: nil)
  
      }
  </code></pre>
  
  <p>and here the function called when keyboard notification is sent :</p>
  
  <pre><code>func adjustForKeyboard(notification: NSNotification) {
      let userInfo = notification.userInfo!
  
      let keyboardScreenEndFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as! NSValue).CGRectValue()
      let keyboardViewEndFrame = view.convertRect(keyboardScreenEndFrame, fromView: view.window)
  
      if notification.name == UIKeyboardWillHideNotification {
          myTableView.contentInset = UIEdgeInsetsZero
          print("ZERO")
      } else {
          myTableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardViewEndFrame.height, right: 0)
      }
  
      myTableView.scrollIndicatorInsets = myTableView.contentInset
  }
  </code></pre>
  
  <p>It's working perfectly for the <code>UITextField</code> but not for the <code>UITextView</code>. Why?</p>