Я пытаюсь сделать простое расширение клавиатуры iOS с помощью Swift. UIView по умолчанию не отвечал моим потребностям, поэтому я прочитал this Вопрос о том, что я мог бы использовать раскадровку с свойством NSExtensionMainStoryboard
в info.plist
.Пользовательская клавиатура iOS с раскадрой
К сожалению, каждый раз, когда я открываю клавиатуру, я получаю следующие ошибки
2016-01-18 18:02:56.350 Kappa Keyboard[44790:2959180] Failed to inherit CoreMedia permissions from 44787: (null)
2016-01-18 18:02:56.368 Kappa Keyboard[44790:2959138] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x002f1746 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x01d32a97 objc_exception_throw + 44
2 CoreFoundation 0x001a6ce1 -[__NSArrayM insertObject:atIndex:] + 881
3 CoreFoundation 0x001a6941 -[__NSArrayM addObject:] + 65
4 UIKit 0x00c7d0bd -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 417
5 UIKit 0x00c968aa -[UIViewController(UIContainerViewControllerProtectedMethods) addChildViewController:] + 78
6 UIKit 0x01206db8 -[_UIViewServiceViewControllerOperator __createViewController:withContextToken:fbsDisplays:appearanceSerializedRepresentations:legacyAppearance:traitCollection:initialInterfaceOrientation:hostAccessibilityServerPort:canShowTextServices:replyHandler:] + 2702
Трассировка стека продолжается, но это суть его.
Вот все, что я сделал (я пробовал это в чистом проекте).
- Создание контейнера приложения
- Создание целевой клавиатуры
- Добавить Main.storyboard
- Добавить
NSExtension.NSExtensionMainStoryboard: Main
в info.plist - Set
Main.storyboard
«s пользовательский класс по умолчаниюKeyboardViewController
Любая идея, что мне не хватает?
Я ценю вашу тщательность, но я ищу раскадровки на основе клавиатуры, а не .xib файл. – Harangue