2026 SwiftUI & UI Frameworks
WWDC26 · 20 min · SwiftUI & UI Frameworks
WidgetKit foundations
Widgets highlight your app’s most important content across the system, providing people with another opportunity to engage. Discover the different types of widgets and explore the qualities that make them memorable. Learn how to create widgets, keep them up to date, and offer ways for people to customize them through App Intents and dynamic styling.
Watch at developer.apple.com ↗Chapters
Code shown on screen · 4 snippets
DailyReadingGoalWidget
struct DailyReadingGoalWidget: Widget {
let kind = "DailyReadingGoalWidget"
var body: some WidgetConfiguration {
StaticConfiguration(
kind: kind,
provider: DailyReadingGoalProvider()
) { entry in
DailyReadingGoalView(book: entry.book,
message: entry.message,
timeOfDay: entry.timeOfDay)
.environment(\.colorScheme, .dark)
.containerBackground(for: .widget) {
Background()
}
}
}
} Supported Families
struct DailyReadingGoalWidget: Widget {
let kind = "DailyReadingGoalWidget"
var body: some WidgetConfiguration {
StaticConfiguration(
kind: kind,
provider: DailyReadingGoalProvider()
) { entry in
DailyReadingGoalView(book: entry.book,
message: entry.message,
timeOfDay: entry.timeOfDay)
.environment(\.colorScheme, .dark)
.containerBackground(for: .widget) {
Background()
}
}
.supportedFamilies([.systemMedium])
}
} Adding deep links
struct DailyReadingGoalWidget: Widget {
let kind = "DailyReadingGoalWidget"
var body: some WidgetConfiguration {
StaticConfiguration(
kind: kind,
provider: DailyReadingGoalProvider()
) { entry in
DailyReadingGoalView(book: entry.book,
message: entry.message,
timeOfDay: entry.timeOfDay)
.environment(\.colorScheme, .dark)
.containerBackground(for: .widget) {
Background()
}
.widgetURL(URL(string: "bookclub://reading/\(book.bookID)"))
}
.supportedFamilies([.systemMedium])
}
} Accented rendering mode
struct BookCoverImage: View {
let imageName: String
var body: some View {
Image(imageName: bundle: .main)
.widgetAccentedRenderingMode(.fullColor)
}
} Related sessions
-
27 min -
15 min -
30 min -
19 min -
24 min