Skip to content

Instantly share code, notes, and snippets.

@BLCKBIRDS
Created January 25, 2020 14:54
Show Gist options
  • Save BLCKBIRDS/c47c31f0d9b3be807c7708dc51cdfa9c to your computer and use it in GitHub Desktop.
Save BLCKBIRDS/c47c31f0d9b3be807c7708dc51cdfa9c to your computer and use it in GitHub Desktop.
init(center: NotificationCenter = .default) {
_center = center
//4. Tell the notification center to listen to the system keyboardWillShow and keyboardWillHide notification
_center.addObserver(self, selector: #selector(keyBoardWillShow(notification:)), name: UIResponder.keyboardWillShowNotification, object: nil)
_center.addObserver(self, selector: #selector(keyBoardWillHide(notification:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment