mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Refactored PreferredColorSchemeModifier out into its own swift file
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// PreferredColorSchemeModifier.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 7/3/20.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct PreferredColorSchemeModifier: ViewModifier {
|
||||
|
||||
var preferredColorScheme: UserInterfaceColorPalette
|
||||
|
||||
@ViewBuilder
|
||||
func body(content: Content) -> some View {
|
||||
switch preferredColorScheme {
|
||||
case .automatic:
|
||||
content.preferredColorScheme(nil)
|
||||
case .dark:
|
||||
content.preferredColorScheme(.dark)
|
||||
case .light:
|
||||
content.preferredColorScheme(.light)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user