Skip to content

wm-j-ray/Keynode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keynode

Carthage compatible Version License Platform

  • textfield example

textfield

  • textview example

textview

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

How to Install Keynode

iOS 8+

Cocoapods

Add the following to your Podfile:

pod "Keynode"
use_frameworks!

Note: the use_frameworks! is required for pods made in Swift.

Carthage

Add the following to your Cartfile:

github "KyoheiG3/Keynode"

iOS 7

Just add everything in the Keynode.swift file to your project.

Usage

import

  • import the Keynode.
import Keynode

Handler

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.

Variable

var gesturePanning: Bool
  • true is lose the keyboard at scroll gesture.
  • Default is true.
var autoScrollInset: Bool
  • true is automatically set the height of the UIScrollView contentInset.bottom of keyboard when open.
  • view of target is the initialization of the argument of Connector.
  • Default is true.
var defaultInsetBottom: CGFloat
  • autoScrollInset specify the Inset.bottom of the case of true.
  • 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.

Function

func setResponder(responder: UIResponder)
  • Can set own responder.

Extension

// UIApplication
func needNotificationForFirstResponder(from: AnyObject?)
  • UIResponderFirstResponderNotification notification by first responder.

Caution

  • Obtain the inputAccessoryView of superview 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.

Acknowledgements

LICENSE

Under the MIT license. See LICENSE file for details.

About

Interactive Keyboard Controller for Swift

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 96.6%
  • Ruby 1.8%
  • Objective-C 1.6%