xcode 如何制作通知中心小部件 (iOS 5)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7224895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to make Notification Center Widgets (iOS 5)
提问by JonasG
iOS 5 introduced Notification Center Widgets and I would like to experiment with those widgets and make custom ones (with a Jailbroken device). I couldn't quite figure out how to make such a widget. The Widgets (WeeApps) are bundles stored in /System/Library/WeeAppPlugins. It would be great if anyone has already writren a guide or could share how the principal class of a WeeApp has to look like. Ideal would be to have a WeeApp NIC template for theos :)
iOS 5 引入了通知中心小部件,我想尝试使用这些小部件并制作自定义小部件(使用越狱设备)。我无法弄清楚如何制作这样的小部件。小部件 (WeeApps) 是存储在 /System/Library/WeeAppPlugins 中的包。如果有人已经编写了指南或可以分享 WeeApp 的主要类的外观,那就太好了。理想的情况是有一个用于 theos 的 WeeApp NIC 模板 :)
Note:This question is regarding so called WeeApps, system plugins for Notification Center introduced in iOS 5. Not to be confused with Today View Extensions introduced in iOS 8.
注意:这个问题是关于所谓的 WeeApps,iOS 5 中引入的通知中心系统插件。不要与 iOS 8 中引入的今日视图扩展混淆。
采纳答案by JonasG
OK i think i have found a good way to understand it, a sample widget with full source code available on github: https://github.com/WillFour20/WeeAppTestBut whats most helpful is this tutorial and the NIC template for theos mentioned in the tutorial, I already made several widgets using this method and my custom NIC templates. http://weeplugins.com/blog/?p=1
好的,我想我已经找到了理解它的好方法,在 github 上提供了一个带有完整源代码的示例小部件:https: //github.com/WillFour20/WeeAppTest但最有用的是本教程和提到的 theos 的 NIC 模板在教程中,我已经使用这种方法和我的自定义 NIC 模板制作了几个小部件。http://weeplugins.com/blog/?p=1
回答by Andy Ibanez
I don't want to shameless-plug in here, but I wrote a small tutorial to help you with this.
我不想在这里无耻地插入,但我写了一个小教程来帮助你。
How to write Notification Center Widgets for iOS (iOS 6 and Below)
Hope it helps you!
希望对你有帮助!
UPDATE
更新
Please note this is for iOS widgets running iOS 6 and below - In other words, this is for old jailbreak development. I may write an iOS 8 tutorial eventually, but this one is not it.
请注意,这适用于运行 iOS 6 及更低版本的 iOS 小部件 - 换句话说,这是用于旧的越狱开发。我最终可能会写一篇 iOS 8 教程,但不是这个。