Created
May 16, 2017 14:11
-
-
Save nithingwl/3cf7d1b6f27450b2008cbddd0cd8355b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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