         }
     }
     
+    /**
+     Sets previous text field as first responder.
+     
+     - author: Michal Konturek
+     */
     public func moveToPreviousField() {
         for index in self.fields.indices {
             if self.fields[index].editing && index != 0 {


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()

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