Creating Widgets in SwiftUI - Castles Part 9

Опубликовано: 04 Май 2021
на канале: Coding With Tom
154
3

We will create Widgets for the Castles App. The widgets will share information with the App through a shared file. One widget will show the information of the castle with the highest attack. The other widget will show a perk with a timer that represents the cooldown time for it. The timer will update in realtime and then switch to static text.

Chapters:
0:00 Creating Widgets
0:21 Adding a Widget Target
1:12 Creating WidgetBundle
2:03 Organizing Files
3:58 Adding App Group
6:23 Fetching info from App Group
7:55 Building Castle Widget
12:41 Castle Use Case
13:42 Implementing Castle Timeline Provider
17:35 Building Perk Widget
21:14 Showing timer in Widget
24:44 Perk Use Case
25:34 Implementing Perk Timeline Provider
27:10 Using Text to display a Timer

Source code: https://github.com/codingWithTom/Cast...

Castles - SwiftUI playlist:    • Castles - SwiftUI