Latest 1.1.1
Homepage https://github.com/bonyadmitr/HideKeyboardTapGestureManager
License MIT
Platforms ios 8.0
Authors

Use https://github.com/bonyadmitr/KeyboardHideManager. This one is deprecated and will be deleted soon.

Icon

Language
CocoaPods Compatible
Carthage Compatible
Platform
License

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

CocoaPods

pod 'HideKeyboardTapGestureManager', '~> 1.0'
Full CocoaPods Guide (click to expand)

[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:

“`bash
$ gem install cocoapods
“`

To integrate HideKeyboardTapGestureManager into your Xcode project using CocoaPods, create file `Podfile` with content:

“`ruby
platform :ios, ‘9.0’
use_frameworks!

target ‘‘ do
pod ‘HideKeyboardTapGestureManager’, ‘~> 1.0’
end
“`

Then, run the following command:

“`bash
$ pod install
“`

Close ‘Your Target Name’.**xcodeproj** and open ‘Your Target Name’.**xcworkspace**.

Carthage (code only)

HideKeyboardTapGestureManager cannot be used in IB due .framework issue. See Code usage section.

github "bonyadmitr/HideKeyboardTapGestureManager" ~> 1.0
Full Carthage Guide (click to expand)

[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with [Homebrew](http://brew.sh/) using the following command:

“`bash
$ brew update
$ brew install carthage
“`

To integrate **HideKeyboardTapGestureManager** into your Xcode project using Carthage, create file `Cartfile` with content:

“`ruby
github “bonyadmitr/HideKeyboardTapGestureManager” ~> 1.0
“`

Run `carthage update` to build the framework and drag the built `HideKeyboardTapGestureManager.framework` into your Xcode project.

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

    1. Setup HideKeyboardTapGestureManager in Class field

usage_2

    1. 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.

Latest podspec

{
    "name": "HideKeyboardTapGestureManager",
    "version": "1.1.1",
    "summary": "Easy to use, codeless manager to hide keyboard by tapping on views for iOS written in Swift.",
    "homepage": "https://github.com/bonyadmitr/HideKeyboardTapGestureManager",
    "authors": {
        "Bondar Yaroslav": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/bonyadmitr/HideKeyboardTapGestureManager.git",
        "tag": "1.1.1"
    },
    "source_files": "Source/**/*.swift",
    "screenshots": [
        "https://raw.githubusercontent.com/bonyadmitr/HideKeyboardTapGestureManager/master/Resources/keyboard_icon.png",
        "https://raw.githubusercontent.com/bonyadmitr/HideKeyboardTapGestureManager/master/Resources/preview.png"
    ],
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This