Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Creating Keyboard Extensions

Creating Keyboard Extensions

This is the talk I gave at the May 2018 Tokyo iOS Meetup

John Estropia

May 12, 2018
Tweet

More Decks by John Estropia

Other Decks in Technology

Transcript

  1. TOKYO IOS MEETUP @JOHNESTROPIA Developer since 2008 (mostly Mobile apps)

    Principal Engineer @ Other hobby projects http://github.com/JohnEstropia/CoreStore
  2. TOKYO IOS MEETUP PITFALL #1 ▸ There is no perfect

    way to access the UITextInput’s instance But this is a good thing security-wise
  3. TOKYO IOS MEETUP PITFALL #1 ▸ There is no perfect

    way to access the UITextInput’s complete text or its length ▸ But there is a workaround that works “most of the time”
  4. TOKYO IOS MEETUP ABC DEF So to get the complete

    text we just append these two together. Right? Right??
  5. TOKYO IOS MEETUP PITFALL #1 ▸ There is no perfect

    way to access the UITextInput’s complete text or its length ▸ Some characters such as (?) and (!) have special treatment! (bug?)
  6. TOKYO IOS MEETUP PITFALL #2 ▸ Keyboard “Full Access” is

    unfortunately needed even for minor functions ▸ Play clicking sounds ▸ Read from or write to a shared NSUserDefaults ▸ Accessing the clipboard
  7. TOKYO IOS MEETUP PITFALL #2 ▸ Keyboard “Full Access” is

    unfortunately needed even for minor functions Info.plist
  8. TOKYO IOS MEETUP PITFALL #2 ▸ Keyboard “Full Access” is

    unfortunately needed even for minor functions
  9. TOKYO IOS MEETUP PITFALL #3 ▸ Apps can reject custom

    keyboards (e.g. for security) UIApplicationDelegate
  10. TOKYO IOS MEETUP PITFALL #4 ▸ Memory allotted to Keyboard

    extensions is severely limited (~30MB) ▸ Avoid using too many nib files / image resources
  11. TOKYO IOS MEETUP TIP #1 ▸ Debugging a Keyboard in

    a specific locale will run any app in that locale ▸ No need to change the device language!
  12. TOKYO IOS MEETUP TIP #2 ▸ You are not restricted

    to a single character per input
  13. TOKYO IOS MEETUP TIP #3 ▸ The Globe button logic

    can be simulated in a single line!
  14. TOKYO IOS MEETUP TIP #3 ▸ The Globe button logic

    can be simulated in a single line!
  15. TOKYO IOS MEETUP TIP #4 ▸ You can check the

    "Allow full access" status by twiddling with the clipboard
  16. TOKYO IOS MEETUP WHAT I'VE LEARNED ▸ There's a ton

    of untapped use-cases in third-party apps that can be improved with custom keyboards ▸ Think of them as plugins