Skip to content

Common functions shared between IQKeyboard related libraries. Not intended to be used independently.

License

Notifications You must be signed in to change notification settings

hackiftekhar/IQKeyboardCore

Repository files navigation

IQKeyboardCore

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod 'IQKeyboardCore'

Usage

IQKeyboardCore is not intended to use independently. It's just a helper and extension for most of the IQKeyboard related libraries

This contains IQTextInputView protocol

@objc public protocol IQTextInputView where Self: UIView, Self: UITextInputTraits {
}

UITextField, UITextView and UISearchBar are the known classes who adopted this protocol within the library

@objc extension UITextField: IQTextInputView {...}

@objc extension UITextView: IQTextInputView {...}

@objc extension UISearchBar: IQTextInputView {...}

This library also contains IQEnableMode which is used by other libraries

@objc public enum IQEnableMode: Int {
    case `default`
    case enabled
    case disabled
}

There are other extension functions which are available on UIView

public extension IQKeyboardExtension where Base: UIView {
    func viewContainingController() -> UIViewController?
    func superviewOf<T: UIView>(type classType: T.Type, belowView: UIView? = nil) -> T?
    func textFieldSearchBar() -> UISearchBar?
    func isAlertViewTextField() -> Bool
}

Above extension functions can be used like below

  view.iq.viewContainingController()
  view.iq.superviewOf(type: UIScrollView.self)
  view.iq.textFieldSearchBar()
  view.iq.isAlertViewTextField()

Author

hackiftekhar, ideviftekhar@gmail.com

License

IQKeyboardCore is available under the MIT license. See the LICENSE file for more info.

About

Common functions shared between IQKeyboard related libraries. Not intended to be used independently.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published