GithubHelp home page GithubHelp logo

qimuya3 / msskeyboardmanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msaps/msskeyboardmanager

0.0 1.0 0.0 817 KB

Utility for managing and assisting with iOS keyboard updates.

License: MIT License

Objective-C 95.75% Ruby 4.25%

msskeyboardmanager's Introduction

MSSKeyboardManager

MSSKeyboardManager

Build Status CocoaPods

MSSKeyboardManager is a utility class that provides enhanced delegation for keyboard updates, and a keyboard dismissal component for UIView.

Installation

MSSKeyboardManager is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MSSKeyboardManager'

Usage

To run the example project, clone the repo. Use pod install in your project.

###Keyboard Manager To use MSSKeyboardManager, initialise the object with a responder that implements MSSKeyboardManagerDelegate via keyboardManagerForResponder:

The following protocol methods are then available to the responder:

- (void)keyboardManager:willShowKeyboardWithUpdate:

- (void)keyboardManager:didShowKeyboardWithUpdate:

- (void)keyboardManager:willHideKeyboardWithUpdate:

- (void)keyboardManager:didHideKeyboardWithUpdate:

- (void)keyboardManager:keyboardWillUpdateFromFrame:isDocked:

- (void)keyboardManager:keyboardDidUpdateToFrame:isDocked:

The MSSKeyboardUpdate object contains all the releavent information for the active update:

  • beginFrame - The frame of the keyboard at the beginning of the update.
  • endFrame - The frame of the keyboard at the end of the update.
  • animationDuration - The duration of the update animation.
  • animationCurve - The update animation curve.
  • isLocal - Whether the update was invoked by the local app (iOS 9+)
  • keyboardVisible - Whether the keyboard will be visible as a result of the update.
  • keyboardDocked - Whether the keyboard is docked during the update (iPad).

###Keyboard Dismisser UIView+MSSKeyboardDismiss is a category on UIView that provides keyboard dismissal on tap.

To allow a UIView to dismiss the keyboard on tap, simply call becomeKeyboardDismissalResponder on the view.

For example, in the context of a UIViewController:

[self.view becomeKeyboardDismissalResponder];

Subviews of the view can then opt out of allowing dismissal on tap with the canDismissKeyboard property (IBInspectable).

The category also provides resignFirstResponderWithCompletion: to allow the keyboard to be dismissed with a completion block.

Requirements

Supports iOS 8 and above.

Author

Merrick Sapsford

Mail: [email protected]

msskeyboardmanager's People

Contributors

msaps avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.