https://github.com/hackiftekhar/iqkeyboardcore
Common functions shared between IQKeyboard related libraries. Not intended to be used independently.
https://github.com/hackiftekhar/iqkeyboardcore
Last synced: over 1 year ago
JSON representation
Common functions shared between IQKeyboard related libraries. Not intended to be used independently.
- Host: GitHub
- URL: https://github.com/hackiftekhar/iqkeyboardcore
- Owner: hackiftekhar
- License: mit
- Created: 2024-07-22T13:00:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T14:05:42.000Z (over 1 year ago)
- Last Synced: 2025-03-10T15:17:36.920Z (over 1 year ago)
- Language: Swift
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# IQKeyboardCore
[](https://travis-ci.org/hackiftekhar/IQKeyboardCore)
[](https://cocoapods.org/pods/IQKeyboardCore)
[](https://cocoapods.org/pods/IQKeyboardCore)
[](https://cocoapods.org/pods/IQKeyboardCore)
## 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](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
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
```swift
@objc public protocol IQTextInputView where Self: UIView, Self: UITextInputTraits {
}
```
UITextField, UITextView and UISearchBar are the known classes who adopted this protocol within the library
```swift
@objc extension UITextField: IQTextInputView {...}
@objc extension UITextView: IQTextInputView {...}
@objc extension UISearchBar: IQTextInputView {...}
```
This library also contains IQEnableMode which is used by other libraries
```swift
@objc public enum IQEnableMode: Int {
case `default`
case enabled
case disabled
}
```
There are other extension functions which are available on UIView
```swift
public extension IQKeyboardExtension where Base: UIView {
func viewContainingController() -> UIViewController?
func superviewOf(type classType: T.Type, belowView: UIView? = nil) -> T?
func textFieldSearchBar() -> UISearchBar?
func isAlertViewTextField() -> Bool
}
```
Above extension functions can be used like below
```swift
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.