We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cd483af commit c05ddfeCopy full SHA for c05ddfe
Sources/Theming/ThemeManager.swift
@@ -9,6 +9,23 @@ import Observation
9
import SwiftUI
10
11
/// Manages the currently available theme in the app.
12
+///
13
+/// Use ``withThemeManager(themeManager:)`` in order to set a ``ThemeManager`` instance to a ``Scene``.
14
+/// ```swift
15
+/// @main
16
+/// struct ThemingDemoApp: App {
17
+/// // MARK: - State Properties
18
+/// @State var myThemeManager: ThemeManager = ThemeManager(initialTheme: .default)
19
20
+/// // MARK: - Body
21
+/// var body: some Scene {
22
+/// WindowGroup {
23
+/// ContentView()
24
+/// }
25
+/// .withThemeManager(themeManager: myThemeManager)
26
27
28
+/// ```
29
@Observable
30
@MainActor
31
public class ThemeManager {
Sources/Theming/Theming.md
0 commit comments