CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

HideKeyboardTapGestureManager 1.1.1

HideKeyboardTapGestureManager 1.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2016
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by zdaecq.




  • By
  • Bondar Yaroslav

HideKeyboardTapGestureManager

Icon

HideKeyboardTapGestureManager - easy to use, codeless manager to hide keyboard by tapping on views for iOS written in Swift.

preview

Structure

Features

  • [x] 3 simple actions to setup
  • [x] Multiple views setup
  • [x] Codeless usage
  • [x] Code only usage
  • [x] Xib support
  • [x] Warning logs for code usage

Requirements

  • Swift 3.0+
  • iOS 8.0+

Installation

Manually

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

Usage

  • 1. Drag Object from Object library

usage_1

  • 2. Setup HideKeyboardTapGestureManager in Class field

usage_2

  • 3. Connect views with targets

usage_3

User Iteraction Enabled

Target must be UIView subclass and user iteraction enabled is on. You can set it in IB in View section: (example for UILabel)

user_iteraction_enabled

or in code:

someView.isUserInteractionEnabled = true

Code usage

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

Xib support

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.

To do

  • [x] Add example
  • [ ] Add tests
  • [ ] Add comments
  • [ ] Add CI

License

HideKeyboardTapGestureManager is released under the MIT license. See LICENSE for details.