Skip to content

Commit 367a535

Browse files
committed
Add image
1 parent 31c8909 commit 367a535

6 files changed

Lines changed: 22 additions & 36 deletions

File tree

Assets/Setting.png

866 KB
Loading

Example/SettingExample.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88

99
/* Begin PBXBuildFile section */
1010
3C25FE1929A696B900C11678 /* Setting in Frameworks */ = {isa = PBXBuildFile; productRef = 3C25FE1829A696B900C11678 /* Setting */; };
11-
3C25FE1B29A6B06C00C11678 /* MainSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE1A29A6B06C00C11678 /* MainSettingView.swift */; };
11+
3C25FE1B29A6B06C00C11678 /* PreferencesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE1A29A6B06C00C11678 /* PreferencesView.swift */; };
1212
3C25FE1D29A6B0AF00C11678 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE1C29A6B0AF00C11678 /* Utilities.swift */; };
13-
3C25FE1F29A6B0D700C11678 /* PlaygroundSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE1E29A6B0D700C11678 /* PlaygroundSettingView.swift */; };
13+
3C25FE1F29A6B0D700C11678 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE1E29A6B0D700C11678 /* SettingsView.swift */; };
1414
3C25FE2229A6C24C00C11678 /* ControlPanelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C25FE2129A6C24C00C11678 /* ControlPanelView.swift */; };
1515
3CD8B78C29A683D100463C48 /* SettingExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD8B78B29A683D100463C48 /* SettingExampleApp.swift */; };
1616
3CD8B78E29A683D100463C48 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD8B78D29A683D100463C48 /* ContentView.swift */; };
1717
3CD8B79029A683D300463C48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3CD8B78F29A683D300463C48 /* Assets.xcassets */; };
1818
/* End PBXBuildFile section */
1919

2020
/* Begin PBXFileReference section */
21-
3C25FE1A29A6B06C00C11678 /* MainSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainSettingView.swift; sourceTree = "<group>"; };
21+
3C25FE1A29A6B06C00C11678 /* PreferencesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreferencesView.swift; sourceTree = "<group>"; };
2222
3C25FE1C29A6B0AF00C11678 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
23-
3C25FE1E29A6B0D700C11678 /* PlaygroundSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaygroundSettingView.swift; sourceTree = "<group>"; };
23+
3C25FE1E29A6B0D700C11678 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
2424
3C25FE2029A6B2FB00C11678 /* Setting */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Setting; path = ..; sourceTree = "<group>"; };
2525
3C25FE2129A6C24C00C11678 /* ControlPanelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ControlPanelView.swift; sourceTree = "<group>"; };
2626
3CD8B78829A683D100463C48 /* SettingExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SettingExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -64,8 +64,8 @@
6464
children = (
6565
3CD8B78B29A683D100463C48 /* SettingExampleApp.swift */,
6666
3CD8B78D29A683D100463C48 /* ContentView.swift */,
67-
3C25FE1A29A6B06C00C11678 /* MainSettingView.swift */,
68-
3C25FE1E29A6B0D700C11678 /* PlaygroundSettingView.swift */,
67+
3C25FE1A29A6B06C00C11678 /* PreferencesView.swift */,
68+
3C25FE1E29A6B0D700C11678 /* SettingsView.swift */,
6969
3C25FE2129A6C24C00C11678 /* ControlPanelView.swift */,
7070
3C25FE1C29A6B0AF00C11678 /* Utilities.swift */,
7171
3CD8B78F29A683D300463C48 /* Assets.xcassets */,
@@ -149,9 +149,9 @@
149149
isa = PBXSourcesBuildPhase;
150150
buildActionMask = 2147483647;
151151
files = (
152-
3C25FE1B29A6B06C00C11678 /* MainSettingView.swift in Sources */,
152+
3C25FE1B29A6B06C00C11678 /* PreferencesView.swift in Sources */,
153153
3CD8B78E29A683D100463C48 /* ContentView.swift in Sources */,
154-
3C25FE1F29A6B0D700C11678 /* PlaygroundSettingView.swift in Sources */,
154+
3C25FE1F29A6B0D700C11678 /* SettingsView.swift in Sources */,
155155
3C25FE2229A6C24C00C11678 /* ControlPanelView.swift in Sources */,
156156
3C25FE1D29A6B0AF00C11678 /* Utilities.swift in Sources */,
157157
3CD8B78C29A683D100463C48 /* SettingExampleApp.swift in Sources */,

Example/SettingExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 14 deletions
This file was deleted.

Example/SettingExample/ContentView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ struct ContentView: View {
1313
@AppStorage("selectedIndex") var selectedIndex = 1
1414
var body: some View {
1515
TabView(selection: $selectedIndex) {
16-
MainSettingView()
16+
PreferencesView()
1717
.tabItem {
18-
Label("Main", systemImage: "text.book.closed.fill")
18+
Label("Preferences", systemImage: "text.book.closed")
1919
}
2020
.tag(0)
21-
22-
Settings()
21+
22+
SettingsView()
2323
.tabItem {
24-
Label("Playground", systemImage: "gamecontroller.fill")
24+
Label("Settings", systemImage: "gearshape")
2525
}
2626
.tag(1)
27-
27+
2828
ControlPanelView()
2929
.tabItem {
3030
Label("Control Panel", systemImage: "dial.high")

Example/SettingExample/MainSettingView.swift renamed to Example/SettingExample/PreferencesView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// MainSettingView.swift
2+
// PreferencesView.swift
33
// SettingExample
44
//
55
// Created by A. Zheng (github.com/aheze) on 2/22/23.
@@ -9,7 +9,7 @@
99
import Setting
1010
import SwiftUI
1111

12-
class MainSettingViewModel: ObservableObject {
12+
class PreferencesViewModel: ObservableObject {
1313
@AppStorage("languageIndex") var languageIndex = 0
1414
@AppStorage("turboMode") var turboMode = true
1515
@AppStorage("brightness") var brightness = Double(50)
@@ -23,8 +23,8 @@ class MainSettingViewModel: ObservableObject {
2323
@Published var showingAlert = false
2424
}
2525

26-
struct MainSettingView: View {
27-
@StateObject var model = MainSettingViewModel()
26+
struct PreferencesView: View {
27+
@StateObject var model = PreferencesViewModel()
2828

2929
var body: some View {
3030
SettingStack {

Example/SettingExample/PlaygroundSettingView.swift renamed to Example/SettingExample/SettingsView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Settings.swift
2+
// SettingsView.swift
33
// SettingExample
44
//
55
// Created by A. Zheng (github.com/aheze) on 2/22/23.
@@ -9,7 +9,7 @@
99
import Setting
1010
import SwiftUI
1111

12-
struct Settings: View {
12+
struct SettingsView: View {
1313
var body: some View {
1414
SettingStack {
1515
SettingPage(title: "Settings") {
@@ -40,9 +40,9 @@ struct Settings: View {
4040
}
4141
}
4242

43-
struct Settings_Previews: PreviewProvider {
43+
struct SettingsView_Previews: PreviewProvider {
4444
static var previews: some View {
45-
Settings()
45+
SettingsView()
4646
}
4747
}
4848

0 commit comments

Comments
 (0)