AppearanceProviding
is a SwiftUI library for selecting a preferred color scheme.
- iOS: 17.0 or later.
- macOS: 14.0 or later.
You can install AppearanceProviding
using the Swift Package Manager.
- In Xcode, select "File" > "Add Package Dependencies".
- Copy & paste the following into the "Search or Enter Package URL" search bar.
https://github.com/JamesSedlacek/AppearanceProviding.git
- Xcode will fetch the repository & the "AppearanceProviding" library will be added to your project.
- Add
.setAppearance()
to the root view in your project.
import AppearanceProviding
import SwiftUI
@main
struct ExampleApp: App {
var body: some Scene {
ContentView()
.setAppearance()
}
}
- Use an Appearance Picker in the settings screen in your project.
import AppearanceProviding
import SwiftUI
struct SettingsView {
var body: some View {
VStack {
AppearanceMenuPicker()
AppearanceSegmentedControl()
AppearanceSheetPicker()
}
}
}