Passing Data to Widget using SwiftUI | iOS Widget Development – Part 1



Passing Data to Widget using SwiftUI | iOS Widget Development – Part 1

Passing Data to Widget using SwiftUI | iOS Widget Development - Part 1

This video shows you how to create widgets, appgroups so that you can configure the widget with data passed from the host app to the widget for the display. 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.
This code is tested on IOS Simulator as well as real device.

Some of the points that I missed in the discussion are
1. 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.
2. Run the app once before adding widgets in case of “UserDefaults”

Example links:
“https://cdn.britannica.com/78/43678-050-F4DC8D93/Starry-Night-canvas-Vincent-van-Gogh-New-1889.jpg”,
“https://source.unsplash.com/user/c_v_r/1700×600”,
“https://source.unsplash.com/user/c_v_r/1800×500”,
“https://source.unsplash.com/user/c_v_r/2000×1000”,
“https://source.unsplash.com/user/c_v_r/1640×720”,
“https://source.unsplash.com/user/c_v_r/1800×900”,
“https://source.unsplash.com/user/c_v_r/1000×500”,
“https://source.unsplash.com/user/c_v_r/1000×500”,
“https://source.unsplash.com/user/c_v_r/1000×500”,
“https://source.unsplash.com/user/c_v_r/1000×500”,
“https://source.unsplash.com/user/c_v_r/1000×500”

Widgets Playlist : https://www.youtube.com/playlist?list=PLkCOvvNBBMGDb7MkqpqEM_YI9Rbsq7rT6

If you like the video give a 👍 and subscribe to the channel and support my work by:
Buy me a coffee ☕ : https://bmc.link/taskeenashK

LinkedIn: https://www.linkedin.com/in/taskeen-ashraf-bbb03135/