Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. let keyboardEndFrameScreenCoordinates = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
  2. let keyboardEndFrame = self.view.convert(keyboardEndFrameScreenCoordinates, to: view.window)
  3.  
  4. if notification.name == Notification.Name.UIResponder.keyboardWillHideNotification {
  5. textView.contentInset = UIEdgeInsets.zero
  6. } else {
  7. textView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardEndFrame.height, right: 0)
  8. textView.scrollIndicatorInsets = textView.contentInset
  9. }
  10.  
  11. textView.scrollRangeToVisible(textView.selectedRange)
  12. }
  13. Can anyone help me out, please?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement