KeyboardProtocol is ready to be used with your UIViewController. Scrollview inset and offset, are automatically calculated on the first responder.
Import the KeyboardExtension.swift file into your Swift project.
Implement KeyboardProtocol:
classViewController:UIViewController,KeyboardProtocol{...}Add and connect the ScrollView:
@IBOutletvarscrollView:UIScrollView!Then register for keyboard notifications:
overridefunc viewDidLoad(){
super.viewDidLoad()self.registerForKeyboardNotification()}and run. :)
KeyboardProtocol is distributed under the MIT license (see LICENSE.md).
Daniele Galiotto (founder) - Co-Founder at Nexor Technology srl - www.nexor.it

