There’s a lot of crap about widgets. IOS14 has been around for a while and is said to be the next gateway to traffic. Before iOS14, after iOS10 is this thing Today Extension. The difference is that widgets can only use SwiftUI. The following is an example of OC project, Xcode version (12.2).
create
Xcode -> File ->New -> Target
As an ios developer, when I encounter problems, it is particularly important to have a learning atmosphere and a communication circle, which is of great help to myself. This is my ios communication group: 711315161, sharing BAT, Ali interview questions, interview experience, discussing technology, and learning and growth together! Hope to help developers avoid detours.
Include Configuration IntEnts Include Configuration Intents Include Configuration Intents Include Configuration Intents Include Configuration Intents Include Configuration Intents Include Configuration Intents Interested in you can try, here is not the first tick (tick will have a pit, after I will have a special). The next step
A new folder will be added to the left side of the project as follows:
Run it directly and see what happens
The desktop generates this component directly. Then long press the component button to edit the home screen and press + to select app, there will be three sizes.
SWidget.swift
Document interpretation.
Er… This is probably so much, where the analysis of the wrong welcome to point out.
Author: Lsx_f links: www.jianshu.com/p/bd60441a1…