 // MARK: Keybaord Handling
 extension KeyboardController {
     
+    /**
+     Closes keyboard.
+     
+     - author: Michal Konturek
+     */
     public func closeKeyboard() {
         for field in self.fields {
             if field.editing {


import UIKit

public protocol KeyboardNotificationHandling: class {
    func onKeyboardDidHide()
    func onKeyboardDidShow()
    func onKeyboardWillHide()
    func onKeyboardWillShow()
}

public class KeyboardController: NSObject {
    public weak var delegate: KeyboardNotificationHandling?
    public weak var textFieldDelegate: UITextFieldDelegate?
    let fields: Array<UITextField>

    convenience public init(field: UITextField) {
        self.init(fields: [field])
    }

    public init(fields: Array<UITextField>) {
        self.fields = fields
        super.init()

        }
    }

    /**
     Sets next text field as first responder.
     
     - author: Michal Konturek
     */
    public func moveToNextField() {
        for index in self.fields.indices {
            if self.fields[index].editing && index != (self.fields.count - 1) {
