TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2016 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by zdaecq.
HideKeyboardTapGestureManager - easy to use, codeless manager to hide keyboard by tapping on views for iOS written in Swift.
If you prefer not to use either of the aforementioned dependency managers, you can integrate HideKeyboardTapGestureManager into your project manually.
Drag HideKeyboardTapGestureManager
folder in your project
HideKeyboardTapGestureManager
in Class fieldtargets
Target must be UIView subclass and user iteraction enabled is on. You can set it in IB in View section: (example for UILabel)
or in code:
someView.isUserInteractionEnabled = true
You can use HideKeyboardTapGestureManager in code:
Connect object:
@IBOutlet var hideKeyboardTapGestureManager: HideKeyboardTapGestureManager!
or add in code:
let hideKeyboardTapGestureManager = HideKeyboardTapGestureManager()
Add new targets:
hideKeyboardTapGestureManager.add(targets: [someView1])
or remove old ones:
hideKeyboardTapGestureManager.remove(targets: [someView2])
hideKeyboardTapGestureManager.removeAllTargets()
To use with xib you must add strong property to controller:
@IBOutlet var hideKeyboardTapGestureManager: HideKeyboardTapGestureManager!
Otherwise it will be deinited. It is logic of Objects in xibs.
HideKeyboardTapGestureManager is released under the MIT license. See LICENSE for details.