title: UITextview's contentInset & scrollIndicatorInsets with keyboard & rotation in Swift?
body: <p>i'm using a UITextView and set it's contentInset &amp; scrollIndicatorInsets when keyboard is show/hide like this:</p>
  
  <pre><code>    override func viewDidLoad() {
          super.viewDidLoad()
  
          NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardShow:", name: UIKeyboardWillShowNotification, object: nil)
          NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardHide:", name: UIKeyboardWillHideNotification, object: nil)
      }
  
      override func shouldAutorotate() -&gt; Bool {
          return !self.keyboardShowing
      }
  
      func keyboardShow(n:NSNotification) {
          self.keyboardShowing = true
  
          let d = n.userInfo!
          var r = (d[UIKeyboardFrameEndUserInfoKey] as! NSValue).CGRectValue()
          r = self.tv.convertRect(r, fromView:nil)
          self.tv.contentInset.bottom = r.size.height
          self.tv.scrollIndicatorInsets.bottom = r.size.height
      }
  
      func keyboardHide(n:NSNotification) {
          self.keyboardShowing = false
          self.tv.contentInset = UIEdgeInsetsZero
          self.tv.scrollIndicatorInsets = UIEdgeInsetsZero
      }
  </code></pre>
  
  <p>It works fine, but when I rotated my device, the scrollIndicatorInsets &amp; contentInset didn't change with my new height. So what can I do? Thanks!</p>
  
  <p>NOTE: The view has a Navigation bar on the top</p>