0

I'm having some performance problems with a custom keyboard I'm working on. Loading all the words in the spell correction tree takes quite a bit of time. This seems to be done each time the keyboard appears - is there any way to preserve the state of the keyboard? Apps can do suspend / resume etc - but I can't find any documentation on how to do this for extensions, or if there's any mechanism for doing this att all.

Thanks!

Malakim
  • 1,333
  • 2
  • 18
  • 34

1 Answers1

0

You are loading dictionary from Internet or from the disk? For the first case NSUserDefaults, encoding (NsCopying) are the options to store info. You can load it in background.

According to the docs, os typically kills extension process, so, I think there is no way to prevent keyboard objects from deallocation (you may use nskeydarchiver).

Renatus
  • 1,123
  • 13
  • 20
  • It's loaded from disk, the dictionary is in a CoreData SQLite store. So I guess the best we can do is to load the words off of disk in order of importance in a background thread. – Malakim Nov 04 '14 at 06:32