iOS widget development

Source: Internet
Author: User

1. Certificate configuration: http://blog.csdn.net/songchunmin_/article/details/51316806

2. Coding phase: http://blog.csdn.net/songchunmin_/article/details/51291752

3. Official Document: Https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Today.html

4. There is a better document abroad: https://www.appcoda.com/app-extension-programming-today/

5.widget implementation of several common functions: HTTP://WWW.JIANSHU.COM/P/9B3D06236D19

Terms:

Main project: Adding widgets to an existing a project, then A is the main project

start~

Environment construction

1. Apple background configuration certificate, download provisioning profiles file, get 4 provisioning Profiles files (the main project and widgets are two: Dev and release).

Note that the widget project and the main project are actually two separate AppID, and the app group interacts with each other.

2. For the main project configuration:

(1) Select a new Pro certificate

(2) Open the Targets-->capabilities-->app Groups option and select the group configured in the background:

3. Add the Widget project.

Change the bundle identifier to the same appid as the Apple backend configuration. Also note that at the time of naming, the following rules must be followed: prefix to include the main project bundle Identifier. The suffix cannot be the widget keyword (...). It's a pit here, tried a lot of times. Then because my Xcode does not configure the developer account, so the automatically manage singing check out (anyway the certificate files are downloaded to you).

Then select the good provisioning profile file, Dev and release. The error on the current page should all be gone.

Set the signature in build setting:

If you were to add your phone to the DeviceID when you configured the certificate in the background of Apple, you could see a "Hello World" widget on your phone by running it directly.

First run, you may see the upper left corner of the name is the widget, this is a little delay, the second time you can see is "Baby Tree small Time."

Business logic Implementation

1. Pure Code Implementation layout:

iOS Widget development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.