- textfield example
- textview example
- change the scroll range at the time of the keyboard display.
- You can perform interactive keyboard display switch.
- You can easily perform the switching of the display to match the height of the keyboard.
Add the following to your Podfile
:
pod "Keynode"
use_frameworks!
Note: the use_frameworks!
is required for pods made in Swift.
Add the following to your Cartfile
:
github "KyoheiG3/Keynode"
Just add everything in the Keynode.swift
file to your project.
- import the Keynode.
import Keynode
var willAnimationHandler: ((show: Bool, rect: CGRect) -> Void)?
- Set the method to be called just before the animation.
var animationsHandler: ((show: Bool, rect: CGRect) -> Void)?
- Set the method to be called when the display switching animation.
- It is also known at the time of the keyboard operation of the scroll gesture.
var completionHandler: ((show: Bool, responder: UIResponder?, keyboard: UIView?) -> Void)?
- Set the method to be called at the end animation.
var gesturePanning: Bool
true
is lose the keyboard at scroll gesture.- Default is
true
.
var autoScrollInset: Bool
true
is automatically set theheight
of theUIScrollView contentInset.bottom
of keyboard when open.view
of target is the initialization of the argument ofConnector
.- Default is
true
.
var defaultInsetBottom: CGFloat
autoScrollInset
specify theInset.bottom
of the case oftrue
.- Default is
0
var gestureOffset: CGFloat
- Such as when there is a
toolbar
, you can specify the offset of when closing the keyboard with scroll gesture. - If the value is not set, the value specified in the
defaultInsetBottom
will be used.
// global
let UIResponderFirstResponderNotification: String
- Notification name for first responder.
// global
let UIResponderFirstResponderUserInfoKey: String
- Notification user info key for first responder.
func setResponder(responder: UIResponder)
- Can set own responder.
// UIApplication
func needNotificationForFirstResponder(from: AnyObject?)
UIResponderFirstResponderNotification
notification by first responder.
- Obtain the
inputAccessoryView
ofsuperview
and has been operating the keyboard, you might not work if the specification has been changed, but it will be addressed in the earliest possible stage. iOS7.0
~iOS9.0
is confirmed operation.
- Inspired by DAKeyboardControl in danielamitay.
Under the MIT license. See LICENSE file for details.