使用Storyboard的iOS8自定义键盘 [英] iOS8 Custom Keyboard using Storyboards

查看:160
本文介绍了使用Storyboard的iOS8自定义键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道如何使用故事板在Xcode6中创建自定义iOS键盘?我使用单个应用程序模板完全使用代码构建了一个键盘。它工作正常,但我想用故事板构建另一个键盘,因为我觉得它会更容易。

Anyone know how to create a custom iOS keyboard in Xcode6 using storyboards? I've built a keyboard fully using code using a single application template. It works fine, but I want to build another keyboard using storyboards as I think it will be easier.

无法弄清楚如何将故事板连接到KeyboardViewController。 M&任何人都知道如何以及一系列步骤来做到这一点?谢谢!

Can't figure out how to connect a storyboard to the KeyboardViewController.m? Anyone know how, and a set of steps to do this? Thanks!

推荐答案

是的,这绝对是可能的。
创建目标扩展程序后,右键单击并添加新故事板。在这个故事板中,你必须将自定义类定义为KeyboardViewController。

Yes it's absolutely possible. Once you created your target extension, right click and add a New Storyboard. Inside this storyboard, you must define the Custom Class as a KeyboardViewController.

然后,缺少一件事:你应该添加 NSExtensionMainStoryboard 带有您新扩展的故事板的名称,但没有扩展名 NSExtensionAttributes 的扩展程序 info.plist 文件并从中删除 NSExtensionMainClass 属性。

Then, one thing is missing: you should add NSExtensionMainStoryboard with the name of your freshly created storyboard without the extension in the NSExtensionAttributes of your extension info.plist file and remove the NSExtensionMainClass property from it.

有点干净并且运行并且vo!使用故事板的键盘!
希望这会有所帮助!

A little clean and run and voilà! A keyboard that use a storyboard! Hope that will help!

这篇关于使用Storyboard的iOS8自定义键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆