KenanAtmaca / Keyboardable

iOS Keyboard Observer Protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keyboardable

iOS Keyboard Observer Protocol

Use

import UIKit

class mainVC: UIViewController, Keyboardable {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        keyboardObserver { (height) in
            //code
        }
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        removeKeyboardObserver()
    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        self.view.endEditing(true)
    }
    
    override var prefersStatusBarHidden: Bool {
        return true
    }
}//

License

Usage is provided under the MIT License. See LICENSE for the full details.

About

iOS Keyboard Observer Protocol

License:MIT License


Languages

Language:Swift 100.0%