ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - IdleHandsApps/IHKeyboardAvoiding: IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!
IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required! - IdleHandsApps/IHKeyboardAvoiding
Visit Site

GitHub - IdleHandsApps/IHKeyboardAvoiding: IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!

GitHub - IdleHandsApps/IHKeyboardAvoiding: IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!

IHKeyboardAvoiding Language: Swift 4.2

An elegant solution for keeping any UIView visible when the keyboard is being shown

alt demo

Requirements

IHKeyboardAvoiding Version
Objective C 2.6.0
Swift 3.0.0 +

Description

IHKeyboardAvoiding will translate any UIView up when the keyboard is being shown, then return it when the keyboard is hidden.

Register an avoidingView(UIView) with IHKeyboardAvoiding; when the keyboard is shown, if the avoidingView's frame will be intersected by the keyboard, then it will move up just above the keyboard. When the keyboard is dismissed, the avoidingView is returned to its original position.

What sets IHKeyboardAvoiding apart from other keyboard avoiding solutions is that it doesn't require placing your content in a UIScrollView. No scroll view is used. And it isn't restricted to keeping UITextFields visible, with IHKeyboardAvoiding any UIView can avoid the keyboard

If Autolayout is used then the constraints are animated, otherwise a CGAffine translation is done.

Supported Features

  • iPhone keyboard
  • iPad docked keyboard
  • iPad undocked keyboard
  • iPad split keyboard
  • landscape & protrait
  • 3rd party keyboards
  • Auto Layout
  • AutoResizingMask (Springs & Struts)

How to install

Add this to your CocoaPods Podfile.

pod 'IHKeyboardAvoiding'

How to use

To set the avoiding view

KeyboardAvoiding.avoidingView = self.avoidingView

Put it in viewDidLoad() or viewDidAppear(_ animated: Bool) depending on your usage

If you're unsure put it in viewDidAppear(_ animated: Bool)

If you need to set the avoidingView, or its properites, dynamically consider putting it in textViewShouldBeginEditing(_ textView: UITextView)

Optional methods
KeyboardAvoiding.setAvoidingView(self.avoidingView, withTriggerView: self.triggerView) Use this to set an avoidingView but have a different view that triggers the avoiding. If a triggerView's frame will be intersected by the keyboard, then the avoidingView will be moved so that the triggerView is above the keyboard KeyboardAvoiding.buffer The avoidingView will move if the keyboard is within buffer points of the triggerView's frame. Default buffer is 0
KeyboardAvoiding.paddingForCurrentAvoidingView The padding to put between the keyboard and triggerView. Default padding is 0

Enable tap to dismiss the keyboard by simply changing any UIView to be an instance of KeyboardDismissingView in you nib/storyboard

Buy now and get this free gift :)

A Codable extension to decode arrays and to catch & log all decoding failures https://github.com/IdleHandsApps/SafeDecoder

Button styles that are centralied and reusable, and hooked up to InterfaceBuilder https://github.com/IdleHandsApps/DesignableButton

A fully automatic status bar overlay for No Internet Connection messages https://github.com/IdleHandsApps/StatusBarOverlay

IHKeyboardAvoiding vs UIScrollView solutions - Fight, fight!

UIScrollView pros:

  • They're quick n easy

IHKeyboardAvoiding pros:

  • You dont have scrollviews littered throughout your app
  • Having multiple scrollviews in your view heirarchy can cause problems
  • When the keyboard hides, scrollviews dont always scroll back to their original position
  • Scrollviews only scroll enough to keep the focused textfield visible
  • IHKeyboardAvoiding provides control over which UIViews are visible when the keyboard appears

Similar keyboard avoiding solutions

https://github.com/michaeltyson/TPKeyboardAvoiding (UIScrollView based)
https://github.com/kirpichenko/EKKeyboardAvoiding (UIScrollView based)
https://github.com/robbdimitrov/RDVKeyboardAvoiding (UIScrollView based) https://github.com/hackiftekhar/IQKeyboardManager (looks interesting) https://github.com/danielamitay/DAKeyboardControl (looks interesting)

Author

It'd be great to hear about any cool apps that are using IHKeyboardAvoiding

License

Distributed under the MIT License

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory