This tutorial shows how you can configure the timeline inside the getTimeline function and display multiple entries on the Widget. Also Learn widgets using SwiftUI | SwiftUI Widget Kit | SwiftUI Building Widgets | How To Create Widgets Using SwiftUI | SwiftUI Custom And Dynamic Widgets | WWDC 2023 SwiftUI Tutorials | SwiftUI Widgets | Widgets Animation. Also it will help you learn how to can fetch remote images inside widgetkit and how to configure the UI of different sizes and styles of widgets (small, medium,large) using swiftui.
Some of the points that I missed in the discussion are
1. AsyncImage will not work with the UI of widget as it works in normal SwiftView. Since widgets need a static data/available data to be shown on UI. It cannot work with data that needs to be downloaded.
2. Also never set the refresh rate to 10 seconds in widgets when deploying app to Appstore as a lot of users will be requesting refresh that can choke your servers. It should be after hours in real-world case.
3. You can adjust the UI with the padding on image and text as you can see some part of text and image are cropped in Widgets UI.
4. The images inside the links "https://source.unsplash.com/user/c_v_r/" will return random images. So you can expect different images each time you run the app.
5. Run the app once before adding widgets in case of "UserDefaults"
#programmingwithapurpose #swiftuitutorial #swiftui #swiftuideveloper #iosdev #widgetkit
Example links:
"https://cdn.britannica.com/78/43678-0...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_...",
"https://source.unsplash.com/user/c_v_..."
Widgets Playlist : • WidgetKit in SwiftUI-IOS
If you like the video give a 👍 and subscribe to the channel. You can also shop extras and if you want to support my work visit below link
/ programmingwithapurpose
If you want to connect with me through LinkedIn : / taskeen-ashraf-bbb03135