4

Is there a way to replace the source of predictive texts in iOS 8 Custom Keyboard extension and show in the predictive text bar? What is the Class for the predictive text bar?

Thanks a lot. I've read the docs but could not find the answers. Please help.

Andrew
  • 15,357
  • 6
  • 66
  • 101
RomeoF
  • 299
  • 3
  • 12

1 Answers1

5

1) You can use UILexicon, which is technically a dictionary of key-value pairs of strings wrapped in a UILExiconEntry object

Apple give the example of "Iphone" turning into "iPhone" and "Nur" turning into "Nur N. Eytan" (from your address book) etc..

But you can make smarter things.

One smart thing for example would be to create an open source project that takes in a JSON of strings and converts it to UILexicon :) I'd use it!

2) Apple give you 320 pixels width and ±215 pixels height for your keyboard.

You are prohibited and technically can't draw outside of these boundaries. What all the companies releasing custom keyboards did was reduce the size of the keys in 20%-25% in order to add a candidate view (predictive text bar)

EDIT: you can adjust the height of your keyboard on iOS8.0 - here's a good pointer: iOS 8 Custom Keyboard: Changing the Height

Good luck!

Community
  • 1
  • 1
nurnachman
  • 4,468
  • 2
  • 37
  • 40
  • 1
    Thanks a lot Nume! This answer not only answers the question but provides an additional alternative solution. – RomeoF Jun 30 '14 at 01:00
  • 3
    You can increase/decrease the height of the custom keyboard any time after it is initialized. You are not bound to 215px +/-. – Fab1n Aug 18 '14 at 17:52
  • 1
    Note that from my experience the UILexicon dictionary is full of identical string pairs, with the exception of a user's manual entries (I have only 2, including "O M W" = On my way!) – SafeFastExpressive Nov 25 '14 at 03:02