用于构建通用应用程序的最新资源/教程?
我正在尝试查找有关如何构建通用应用程序的最新教程或资源。我想知道最佳实践、方法和代码。
我之前构建了一些 iPad 应用程序,我想将它们重构为 iPhone 应用程序。
我发现的最新内容是去年四月写的: http:// www.kotancode.com/2011/04/05/ios-universal-apps/
不确定它是否还好?任何帮助表示赞赏,谢谢。
I'm trying to find up to date tutorials or resources on how to build a Universal app. I'd like to know the best practices, methodologies and code.
I've previously built a few iPad apps that I'd like to refactor into iPhone apps.
The latest I've found was written last year April: http://www.kotancode.com/2011/04/05/ios-universal-apps/
Not sure if its still good? Any help appreciated, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通用应用程序最近没有太多变化,因此您不太可能找到任何包含“新”信息的资源。某些 API 只能在 iPad 上使用(例如 SplitView),但大多数 API 方法只能在两种设备上使用。
那篇文章似乎是一个很好的资源。正如他们提到的,您将主要使用此开关在代码中测试设备类型:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
。或者,您可以使用UIUserInterfaceIdiomPhone
检查 iPhone/iPod touch 设备。请记住,这些是 SDK 3.2+。另外,我建议您在 Xcode 中创建一个新的通用项目,并查看通用项目的默认值是什么。自您启动项目以来,您可能可以利用更新的代码。
There haven't been that many changes for Universal apps recently so you're not likely to find any resources with "new" information. Certain APIs are for use on the iPad only (such as SplitView) but most API methods just work across both devices.
That post seems like a fine resource. As they mention, you'll primarily test for the type of device in code using this switch:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
. Alternatively, you can check for an iPhone/iPod touch device withUIUserInterfaceIdiomPhone
. Keep in mind that these are SDK 3.2+.Also, I recommend that you create a new universal project in Xcode and see what the defaults for a universal project are. There may be updated code that you can take advantage of since you started your project.
我使用过这些文档,希望它对您也有用。
通用应用程序
I have used this documents hope it will be useful for you too.
Universal Application