简体   繁体   中英

iOS Widgets & Notification Center

Do Widgets in iOS 11 run in the foreground or background ?

Are Widgets updated/call the containing app when the Today View or Notification Center is simply interacted with on an 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.

When user sees the widget, widgetPerformUpdate(completionHandler:) method gets called and at this instance we have to update its data.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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