Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let keyboardEndFrameScreenCoordinates = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue
- let keyboardEndFrame = self.view.convert(keyboardEndFrameScreenCoordinates, to: view.window)
- if notification.name == Notification.Name.UIResponder.keyboardWillHideNotification {
- textView.contentInset = UIEdgeInsets.zero
- } else {
- textView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardEndFrame.height, right: 0)
- textView.scrollIndicatorInsets = textView.contentInset
- }
- textView.scrollRangeToVisible(textView.selectedRange)
- }
- Can anyone help me out, please?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement