mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,35 +14,35 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import DesignKit
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import DesignKit
|
||||
|
||||
private struct ThemeKey: EnvironmentKey {
|
||||
static let defaultValue = ThemePublisher.shared.theme
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
var theme: ThemeSwiftUI {
|
||||
get { self[ThemeKey.self] }
|
||||
set { self[ThemeKey.self] = newValue }
|
||||
}
|
||||
var theme: ThemeSwiftUI {
|
||||
get { self[ThemeKey.self] }
|
||||
set { self[ThemeKey.self] = newValue }
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
func theme(_ theme: ThemeSwiftUI) -> some View {
|
||||
environment(\.theme, theme)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
func theme(_ themeId: ThemeIdentifier) -> some View {
|
||||
environment(\.theme, themeId.themeSwiftUI)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user