All Projects → louisdh → KeyCommandAlertController

louisdh / KeyCommandAlertController

Licence: other
UIAlertController wrapper to add keyboard shortcuts easily

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to KeyCommandAlertController

Panelkit
PanelKit is a UI framework that enables panels on iOS. A panel can be presented in the following ways:
Stars: ✭ 3,835 (+23868.75%)
Mutual labels:  ux, uikit, ipad
ALButtonMenu
A simple, fully customizable menu solution for iOS.
Stars: ✭ 45 (+181.25%)
Mutual labels:  uikit, ipad
Uicollectionviewsplitlayout
UICollectionViewSplitLayout makes collection view more responsive.
Stars: ✭ 226 (+1312.5%)
Mutual labels:  uikit, ipad
awesome-neumorphism
A curated list of awesome Neumorphism resources.
Stars: ✭ 15 (-6.25%)
Mutual labels:  ux, uikit
BJOTPViewController
Entering OTP made simpler.
Stars: ✭ 42 (+162.5%)
Mutual labels:  uikit, ipad
Shards Dashboard Vue
A free Vue admin dashboard template pack featuring a modern design system and lots of custom templates and components.
Stars: ✭ 363 (+2168.75%)
Mutual labels:  ux, uikit
pikko
Color picker for iOS made with ❤️
Stars: ✭ 34 (+112.5%)
Mutual labels:  ux, uikit
jyutping
Cantonese Jyutping Keyboard for iOS. 粵語粵拼輸入法鍵盤
Stars: ✭ 23 (+43.75%)
Mutual labels:  keyboard, ipad
Peel Off Animation Example Code
Example code for https://robb.is/working-on/a-peel-off-animation
Stars: ✭ 37 (+131.25%)
Mutual labels:  ux, uikit
Uikit Playground
Blog posts about things I learned over the years working with UIKit and accompanying sample code.
Stars: ✭ 95 (+493.75%)
Mutual labels:  ux, uikit
Overlap
Tiny iOS library to achieve overlap visual effect
Stars: ✭ 133 (+731.25%)
Mutual labels:  ux, uikit
Numericaltextentry
An iOS library for beautiful number entry fields. iPad friendly. Written in Swift.
Stars: ✭ 16 (+0%)
Mutual labels:  keyboard, ipad
swift-declarative-configuration
Declarative configuration for your objects
Stars: ✭ 46 (+187.5%)
Mutual labels:  uikit
iPatch
Patch iPA Files With Dynamic Libraries
Stars: ✭ 29 (+81.25%)
Mutual labels:  ipad
UX-UI-Navigation
UX / UI Custom NavigationDrawer with Fragment
Stars: ✭ 70 (+337.5%)
Mutual labels:  ux
improved-osk-gnome-ext
Improved On Screen Keyboard for Gnome Shell
Stars: ✭ 22 (+37.5%)
Mutual labels:  keyboard
JSONRenderKit
🚗This is a funny project. It fetchs a JSON to generate iOS UI and use JavaScript to communicate with Objective-C .
Stars: ✭ 45 (+181.25%)
Mutual labels:  uikit
AndroidUiKit
uikit widget common baseview Adapter faster develop
Stars: ✭ 48 (+200%)
Mutual labels:  uikit
Master3
Master3 – modern, comfortable and flexible template for Joomla! 3, based on the UIkit 3 framework
Stars: ✭ 21 (+31.25%)
Mutual labels:  uikit
spiro
Swift Playgrounds 4 app created on the iPad
Stars: ✭ 48 (+200%)
Mutual labels:  ipad

KeyCommandAlertController

This project contains wrappers for UIAlertController and UIAlertAction to easily add keyboard shortcuts (known as key command).

The following example shows how the action sheet shown above is created:

let alert = KeyCommandAlertController(title: "Change background color", message: nil, preferredStyle: .actionSheet)

alert.popoverPresentationController?.barButtonItem = sender

let redShortcut = KeyCommandShortcut(input: "B", modifierFlags: .command)
let redAction = KeyCommandAlertAction(title: "Blue", style: .default, keyShortcut: redShortcut) { (action) in
	self.makeBlue()
}

let greenShortcut = KeyCommandShortcut(input: "R", modifierFlags: .command)
let greenAction = KeyCommandAlertAction(title: "Red", style: .default, keyShortcut: greenShortcut) { (action) in
	self.makeRed()
}

let cancelAction = KeyCommandAlertAction(title: "Cancel", style: .cancel)

alert.addAction(redAction)
alert.addAction(greenAction)
alert.addAction(cancelAction)

present(alert, animated: true, completion: nil)

TODO

  • Only show shortcuts in alert actions when external keyboard is connected
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].