title: Fix these ugly results when implementing moving up view when keyboard pops up
body: <p>Here is my code.</p>
  
  <pre><code>    NotificationCenter.default.addObserver(self, selector: #selector(ViewController.keyboardWillShow), name: NSNotification.Name.UIKeyboardDidShow, object: nil)
  
      NotificationCenter.default.addObserver(self, selector: #selector(ViewController.keyboardWillHide), name: NSNotification.Name.UIKeyboardWillHide, object: nil)
  
  
  @objc func keyboardWillShow(notification: NSNotification){
      guard let userInfo = notification.userInfo else {return}
      guard let keyboardSize = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue else {return}
  
      let keyboardFrame = keyboardSize.cgRectValue
      if (self.view.frame.origin.y == 0) {
          self.view.frame.origin.y -= keyboardFrame.height
      }
  }
  
  @objc func keyboardWillHide(notification: NSNotification) {
      if (self.view.frame.origin.y != 0) {
          self.view.frame.origin.y = 0
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/hsDZX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hsDZX.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/0unaA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0unaA.png" alt="enter image description here"></a></p>
  
  <p>Is there a way to just move up the textview instead of the entire viewcontroller?</p>