mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
Update RiotSwiftUI symbols to triple slash documentation style with function annotations.
This commit is contained in:
@@ -17,13 +17,11 @@
|
||||
import Foundation
|
||||
import DesignKit
|
||||
|
||||
/**
|
||||
Extension to `ThemeIdentifier` for getting the SwiftUI theme.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
extension ThemeIdentifier {
|
||||
fileprivate static let defaultTheme = DefaultThemeSwiftUI()
|
||||
fileprivate static let darkTheme = DarkThemeSwiftUI()
|
||||
/// Extension to `ThemeIdentifier` for getting the SwiftUI theme.
|
||||
public var themeSwiftUI: ThemeSwiftUI {
|
||||
switch self {
|
||||
case .light:
|
||||
|
||||
@@ -31,25 +31,21 @@ extension EnvironmentValues {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
A theme modifier for setting the theme for this view and all its descendants in the hierarchy.
|
||||
- Parameters:
|
||||
- theme: a Theme to be set as the environment value.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
/// A theme modifier for setting the theme for this view and all its descendants in the hierarchy.
|
||||
/// - Parameter theme: A theme to be set as the environment value.
|
||||
/// - Returns: The target view with the theme applied.
|
||||
func theme(_ theme: ThemeSwiftUI) -> some View {
|
||||
environment(\.theme, theme)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
A theme modifier for setting the theme by id for this view and all its descendants in the hierarchy.
|
||||
- Parameters:
|
||||
- themeId: ThemeIdentifier of a theme to be set as the environment value.
|
||||
*/
|
||||
@available(iOS 14.0, *)
|
||||
extension View {
|
||||
/// A theme modifier for setting the theme by id for this view and all its descendants in the hierarchy.
|
||||
/// - Parameter themeId: ThemeIdentifier of a theme to be set as the environment value.
|
||||
/// - Returns: The target view with the theme applied.
|
||||
func theme(_ themeId: ThemeIdentifier) -> some View {
|
||||
return environment(\.theme, themeId.themeSwiftUI)
|
||||
}
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
/**
|
||||
Provides the theme and theme updates to SwiftUI.
|
||||
Replaces the old ThemeObserver. Riot app can push updates to this class
|
||||
removing the dependency of this class on the `ThemeService`.
|
||||
*/
|
||||
/// Provides the theme and theme updates to SwiftUI.
|
||||
///
|
||||
/// Replaces the old ThemeObserver. Riot app can push updates to this class
|
||||
/// removing the dependency of this class on the `ThemeService`.
|
||||
@available(iOS 14.0, *)
|
||||
class ThemePublisher: ObservableObject {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user