Latest 1.3.0
Homepage https://github.com/freshOS/KeyboardLayoutGuide
License MIT
Platforms ios 9, requires ARC

⌨️ KeyboardLayoutGuide

Apple’s missing KeyboardLayoutGuide

Language: Swift 4
Platform: iOS 9+
Carthage compatible
CocoaPods compatible
License: MIT
GitHub tag

  • [x] No Subclassing / Protocol inheritance / obscure overrides
  • [x] No more keyboard notification handling
  • [x] UIKit Friendly
  • [x] Takes safeArea into account
  • [x] Only animates if view is fully on screen

Keyboard+LayoutGuide

How to use it

Simply constrain your views to the KeyboardLayoutGuide’s top anchor the way you would do natively:

override func viewDidLoad() {
    super.viewDidLoad()

    // Pin your button to the keyboard
    button.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor).isActive = true
}

Bonus: if you’re using Stevia, this gets even more concise o/

button.Bottom == view.keyboardLayoutGuide.Top

If you add your view in Interface Builder, don’t forget to enable the "Remove at build time" checkbox for the bottom constraint:

Keyboard+LayoutGuide

Installation

CocoaPods

To install KeyboardLayoutGuide via CocoaPods, add the following line to your Podfile:

target 'MyAppName' do
  pod 'Keyboard+LayoutGuide'
  use_frameworks!
end

Carthage

To install KeyboardLayoutGuide via Carthage, add the following line to your Cartfile:

github "freshos/KeyboardLayoutGuide"

Manually

Just add Keyboard+LayoutGuide.swift to your Xcode project.

License

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

Latest podspec

{
    "name": "Keyboard+LayoutGuide",
    "version": "1.3.0",
    "summary": "Apple's missing KeyboardLayoutGuide",
    "homepage": "https://github.com/freshOS/KeyboardLayoutGuide",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "freshOS",
    "source": {
        "git": "https://github.com/freshOS/KeyboardLayoutGuide.git",
        "tag": "1.3.0"
    },
    "social_media_url": "https://twitter.com/sachadso",
    "source_files": "KeyboardLayoutGuide/KeyboardLayoutGuide/*.swift",
    "requires_arc": true,
    "platforms": {
        "ios": "9"
    },
    "description": "An alternative approach to handling keyboard in iOS with Autolayout",
    "module_name": "KeyboardLayoutGuide"
}

Pin It on Pinterest

Share This