1

I’m implementing a settings bundle for a custom keyboard using the Apple Keyboard Extension documentation and the settings tutorial it links to.

This method works in the parent app, but when I implement it as identically as possible for the keyboard extension, the settings bundle does not appear to save any of the data, as shown in this video. It seems as if something is resetting the values near-constantly: any time I exit the settings view (e.g. Multitasking view, previous settings page), the values are set to zero (not default: empty, false, and zero respectively). This is the default settings bundle template, no edits, not referred to in code.

Is there a special implementation for extension settings not explicitly stated in the documentation (or that I missed) that is causing this?

For clarity, the steps I took (after creating the extension):

  1. Created the bundle with New File –> Settings Bundle.
  2. Named it, targeted the keyboard extension.
  3. Built and ran.

These were the same steps I took for the parent app (targeting the app), which was able to save settings.

This is on a physical iOS 11.0 (15A5326a) device; app built with Xcode 9.0 (9M202q), Swift 4.

  • I have this exact problem. I am thinking of using the app for settings and using app groups to access them. The downside being that the settings appear under the app name and not under the keyboard settings. – R OMS Oct 19 '17 at 14:32
  • @ROMS : Pretty much. I’m also hoping to keep the user experience simple, which, while possibly achievable with in-app settings, would be more difficult without a fix for this. – afishershin Oct 20 '17 at 02:23

0 Answers0