简体   繁体   English

iOS小工具和通知中心

[英]iOS Widgets & Notification Center

Do Widgets in iOS 11 run in the foreground or background ? iOS 11中的小部件可以在foreground还是在background运行?

Are Widgets updated/call the containing app when the Today View or Notification Center is simply interacted with on an iPhone? 当仅在iPhone上与“今日视图”或“通知中心”进行交互时,小部件是否会更新/调用包含的应用程序? or must the Widget be physically touched/selected to update or communicate with the containing app? 还是必须物理触摸/选择小部件才能与包含的应用进行更新或通信?

Widgets are small apps containing all the business logic, networking and UI elements. 窗口小部件是包含所有业务逻辑,网络和UI元素的小型应用程序。

When user sees the widget, widgetPerformUpdate(completionHandler:) method gets called and at this instance we have to update its data. 当用户看到窗口小部件时,将调用widgetPerformUpdate(completionHandler:)方法,在这种情况下,我们必须更新其数据。

There is limited functionality available for data sharing & interaction between widget and the application and very little memory is provided for widget so it needs to be light in weight without big third party frameworks. 窗口小部件与应用程序之间的数据共享和交互功能有限,并且为窗口小部件提供的内存很少,因此,在没有大型第三方框架的情况下,其重量应轻巧。

Have a look at this tutorial to get you started: https://www.raywenderlich.com/150953/today-extension-tutorial-getting-started 请看一下本教程以开始使用: https : //www.raywenderlich.com/150953/today-extension-tutorial-getting-started

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM