iOS Widget 01 - Build Your First iOS Widget

Demo-01 Download.zip

Build iOS Widget

Let’s start by building our simple App. Open up Xcode and create a new iOS App Project; make sure SwiftUI is selected in the Interface options and SwiftUI App is selected in the Life Cycle options.

And then create a new target. File -> New -> Target. In the searchText input Widget, select Widget Extension and go to Next. Then will got a Activate “MainWidgetExtension” scheme?, select Activate.

createApp create Target
img - img
img - img

In the Left Bar we can see the Widget Target Code, and we can see the widget’s preview. Just change the body code, can update the Widget View.

Code

img

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy