freshOS/KeyboardLayoutGuide

Swift
iOS

⌨️ KeyboardLayoutGuide, back from when it didn't exist.

iosswiftkeyboardkeyboard-layoutlayoutguidelayoutautolayout
Sterne-Wachstum
Sterne
1.2k
Forks
60
Wochenwachstum
+0
Issues
5
5001k
Jan. 2023März 2024Juni 2025Sept. 2026
README

⌨️ KeyboardLayoutGuide

Apple's missing KeyboardLayoutGuide

Language: Swift 5 Platform: iOS 9+ SPM compatible Build Status codebeat badge License: MIT GitHub tag

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

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:

Safe Area

By default, KeyboardLayoutGuide will align your item with the bottom safe area. This is a behaviour that can be opt out by using keyboardLayoutGuideNoSafeArea instead of keyboardLayoutGuide.

Installation

The Swift Package Manager (SPM) is now the official way to install KeyboardLayoutGuide. The other package managers are now deprecated as of 1.7.0 and won't be supported in future versions.

Swift Package Manager

Xcode > File > Swift Packages > Add Package Dependency... > Paste https://github.com/freshOS/KeyboardLayoutGuide

CocoaPods - Deprecated

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

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

Carthage - Deprecated

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.

Ähnliche Repositories
flutter/flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond

DartlibraryBSD 3-Clause "New" or "Revised" Licensemobileandroid
flutter.dev
178.9k31.1k
react/react-native

A framework for building native applications using React

C++MIT Licenseandroidapp-framework
reactnative.dev
126.5k25.2k
rustdesk/rustdesk

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

Rustcrates.ioappGNU Affero General Public License v3.0remote-controlremote-desktop
rustdesk.com
123k18.9k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

awesomeGNU General Public License v3.0pythonjavascript
weibo.com/justjavac
118.8k28.3k
Solido/awesome-flutter

An awesome list that curates the best Flutter libraries, tools, tutorials, articles and more.

Dartawesomeflutterawesome-list
61.1k6.9k
FiloSottile/mkcert

A simple zero-config tool to make locally trusted development certificates with any names you'd like.

GoGo ModulescliBSD 3-Clause "New" or "Revised" Licensehttpstls
mkcert.dev
59.6k3.1k
appwrite/appwrite

Appwrite® - complete cloud infrastructure for your web, mobile and AI apps. Including Auth, Databases, Storage, Functions, Messaging, Hosting, Realtime and more

TypeScriptnpmBSD 3-Clause "New" or "Revised" Licenseappwritedocker
appwrite.io
57.3k5.7k
google/material-design-icons

Material Design icons by Google (Material Symbols)

libraryApache License 2.0materialmaterial-design
google.github.io/material-design-icons/
53.9k9.7k
vsouza/awesome-ios

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

SwiftawesomeMIT Licenseawesomeswift-library
awesomeios.dev
53.3k7k
ionic-team/ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

TypeScriptnpmlibraryMIT Licenseionicmobile
ionicframework.com
52.7k13.3k
expo/expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.

TypeScriptnpmlibraryMIT Licensemobileexpo
docs.expo.dev
52.1k13.9k
dkhamsing/open-source-ios-apps

:iphone: Collaborative List of Open-Source iOS Apps

awesomeCreative Commons Zero v1.0 Universaliosswift
52k6.1k