Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class ViewController:UIViewController, KeyboardObserver{
//@IBOutlet weak var scrollViewOutlet:UIScrollView!
var container:UIView{
return self.view
//If container is a scrollview, create an outlet for scrollview and return it like below
//return self.scrollViewOutlet
}
//Register for Keyboard Notifications
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
KeyboardNotifications(shouldRegister: true)
}
//Deregister for keyboard Notifications
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
KeyboardNotifications(shouldRegister: false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment