From 17983a43d4e8e893eb460f02e9e1106109099777 Mon Sep 17 00:00:00 2001 From: Remi Regnault Date: Mon, 27 May 2024 17:30:18 +0200 Subject: [PATCH 1/6] :construction: working on settings page --- .../DouShouQi_App.xcodeproj/project.pbxproj | 16 +++++ .../Settings/CustomSwitchButton.swift | 48 +++++++++++++ .../Views/Menu/MainMenuView.swift | 1 + .../Views/Menu/SettingsView.swift | 71 +++++++++++++++++++ 4 files changed, 136 insertions(+) create mode 100644 DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift create mode 100644 DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index 13e4fcf..1407c7a 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -31,6 +31,8 @@ 649B59AE2BF64EAB002BAE38 /* AppImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59AD2BF64EAB002BAE38 /* AppImages.swift */; }; 649B59B22BF65392002BAE38 /* TextStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59B12BF65392002BAE38 /* TextStyles.swift */; }; 649B59B42BF653E1002BAE38 /* ViewTitleTextStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59B32BF653E1002BAE38 /* ViewTitleTextStyle.swift */; }; + EC05BFC42C04C3C4000F7B19 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC05BFC32C04C3C4000F7B19 /* SettingsView.swift */; }; + EC05BFC82C04D832000F7B19 /* CustomSwitchButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC05BFC72C04D832000F7B19 /* CustomSwitchButton.swift */; }; EC62C4EF2BFE367F0048CD0B /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4EE2BFE367F0048CD0B /* SwiftUIView.swift */; }; EC62C4F92C0371660048CD0B /* MusicPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4F82C0371660048CD0B /* MusicPlayer.swift */; }; EC62C4FB2C038BD20048CD0B /* PlayersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4FA2C038BD20048CD0B /* PlayersView.swift */; }; @@ -101,6 +103,8 @@ 649B59AD2BF64EAB002BAE38 /* AppImages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppImages.swift; sourceTree = ""; }; 649B59B12BF65392002BAE38 /* TextStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextStyles.swift; sourceTree = ""; }; 649B59B32BF653E1002BAE38 /* ViewTitleTextStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewTitleTextStyle.swift; sourceTree = ""; }; + EC05BFC32C04C3C4000F7B19 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + EC05BFC72C04D832000F7B19 /* CustomSwitchButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSwitchButton.swift; sourceTree = ""; }; EC62C4EE2BFE367F0048CD0B /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; EC62C4F82C0371660048CD0B /* MusicPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlayer.swift; sourceTree = ""; }; EC62C4FA2C038BD20048CD0B /* PlayersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayersView.swift; sourceTree = ""; }; @@ -248,6 +252,7 @@ children = ( 649ABF5A2BF60D78002E8894 /* MainMenuView.swift */, EC62C5082C0467240048CD0B /* SplashScreenView.swift */, + EC05BFC32C04C3C4000F7B19 /* SettingsView.swift */, ); path = Menu; sourceTree = ""; @@ -265,6 +270,7 @@ 649ABF5E2BF60ED5002E8894 /* Components */ = { isa = PBXGroup; children = ( + EC05BFC62C04D7C2000F7B19 /* Settings */, 643AB6912BFCEFB70018DA73 /* Game */, 645B4C1C2BFCC95000FD658A /* Player */, 649ABF5F2BF60F2D002E8894 /* MainMenuButton.swift */, @@ -314,6 +320,14 @@ path = TextStyles; sourceTree = ""; }; + EC05BFC62C04D7C2000F7B19 /* Settings */ = { + isa = PBXGroup; + children = ( + EC05BFC72C04D832000F7B19 /* CustomSwitchButton.swift */, + ); + path = Settings; + sourceTree = ""; + }; EC62C5022C045BB90048CD0B /* SoundPlayerClass */ = { isa = PBXGroup; children = ( @@ -477,11 +491,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + EC05BFC42C04C3C4000F7B19 /* SettingsView.swift in Sources */, 643AB69B2BFCFB5C0018DA73 /* HistoricView.swift in Sources */, 6458345E2BF5F92300E18321 /* ContentView.swift in Sources */, 649B59A92BF64C6A002BAE38 /* Colors.swift in Sources */, 649B59B42BF653E1002BAE38 /* ViewTitleTextStyle.swift in Sources */, EC62C5012C045B590048CD0B /* SoundPlayer.swift in Sources */, + EC05BFC82C04D832000F7B19 /* CustomSwitchButton.swift in Sources */, 645B4C252BFCD3C600FD658A /* ScoreBoardView.swift in Sources */, 649B59AE2BF64EAB002BAE38 /* AppImages.swift in Sources */, 649ABF602BF60F2D002E8894 /* MainMenuButton.swift in Sources */, diff --git a/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift new file mode 100644 index 0000000..871d815 --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift @@ -0,0 +1,48 @@ +// +// CustomSwitchButton.swift +// DouShouQi_App +// +// Created by etudiant on 27/05/2024. +// + +import SwiftUI + +struct CustomSwitchButton: View { + + // Boolean + @Binding var IsOn: Bool + + // Image when Off + var imgNameIsOff: String + var imgIsOffWidth: CGFloat = 50 + var imgIsOffHeight: CGFloat = 50 + + // Image when Off + var imgNameIsOn: String + var imgIsOnWidth: CGFloat = 50 + var imgIsOnHeight: CGFloat = 50 + + var body: some View { + HStack { + Image(imgNameIsOff) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: imgIsOffWidth, height: imgIsOffHeight) + + Toggle("isOn", isOn: $IsOn) + .labelsHidden() + + Image(imgNameIsOn) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: imgIsOnWidth, height: imgIsOnHeight) + } + } +} + +struct CustomSwitchButton_Previews: PreviewProvider { + static var previews: some View { + @State var isOn: Bool = false + CustomSwitchButton(IsOn: $isOn, imgNameIsOff: AppImages.TitleImage, imgNameIsOn: AppImages.TitleImage) + } +} diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift index 6a893d5..e99136c 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift @@ -36,6 +36,7 @@ struct MainMenuView: View { MainMenuButton(text: "Historique", destination: HistoricView(), sound: "TitleScreenButtonSound") MainMenuButton(text: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound") MainMenuButton(text: "Players", destination: PlayersView(), sound: "TitleScreenButtonSound") + MainMenuButton(text: "Settings", destination: SettingsView(), sound: "TitleScreenButtonSound") } Image(AppImages.SemiLion) .resizable() diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift new file mode 100644 index 0000000..a2c09f7 --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift @@ -0,0 +1,71 @@ +// +// SettingsView.swift +// DouShouQi_App +// +// Created by etudiant on 27/05/2024. +// + +import SwiftUI + +extension String : Identifiable { + public var id: Self { return self } +} + +struct SettingsView: View { + + @State private var theme = false + @State private var choice = "English" + @State private var sound = false + + var body: some View { + VStack { + TitlePageFrame(Text: "Settings") + + VStack { + Divider() + + HStack { + Text("Theme") + .font(.headline) + + Spacer() + + CustomSwitchButton(IsOn: $theme, imgNameIsOff: AppImages.TitleImage, imgNameIsOn: AppImages.TitleImage) + } + + Divider() + + HStack { + Text("Language") + .font(.headline) + + Spacer() + + Picker("Sort", selection: $choice) { + ForEach(["English", "Français", "Español"]) { + Text($0) + } + } + .pickerStyle(.menu) + } + + Divider() + + VStack(alignment: .leading) { + Toggle("Sound", isOn: $sound) + .toggleStyle(.switch) + .font(.headline) + } + + Divider() + } + .padding(20) + + Spacer() + } + } +} + +#Preview { + SettingsView() +} From aabe88fbc80cf99e867debebacbcbf11fa3703e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 16:28:06 +0200 Subject: [PATCH 2/6] :construction: removing preview on CustomSwitchButton (can not declare @state in preview) --- .../Components/Settings/CustomSwitchButton.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift index 871d815..e599a88 100644 --- a/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift +++ b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift @@ -40,9 +40,9 @@ struct CustomSwitchButton: View { } } -struct CustomSwitchButton_Previews: PreviewProvider { - static var previews: some View { - @State var isOn: Bool = false - CustomSwitchButton(IsOn: $isOn, imgNameIsOff: AppImages.TitleImage, imgNameIsOn: AppImages.TitleImage) - } -} +//struct CustomSwitchButton_Previews: PreviewProvider { +// static var previews: some View { +// @State var isOn: Bool = false +// CustomSwitchButton(IsOn: $isOn, imgNameIsOff: AppImages.TitleImage, imgNameIsOn: AppImages.TitleImage) +// } +//} From 039fa0550af798f382af22fd0678381387777ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 16:28:58 +0200 Subject: [PATCH 3/6] :construction: changing preview code in SettingsView --- DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift index a2c09f7..27e0dee 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift @@ -66,6 +66,8 @@ struct SettingsView: View { } } -#Preview { - SettingsView() +struct SettingsView_Previews: PreviewProvider { + static var previews: some View { + SettingsView() + } } From 63eeb921e3213dc4095f3a337b92106c86ef7708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 16:55:23 +0200 Subject: [PATCH 4/6] :sparkles: CustomSwitchButton is now using system image name --- .../Settings/CustomSwitchButton.swift | 36 +++++++++++-------- .../Views/Menu/SettingsView.swift | 13 ++++--- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift index e599a88..560ffd9 100644 --- a/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift +++ b/DouShouQi_App/DouShouQi_App/Components/Settings/CustomSwitchButton.swift @@ -13,29 +13,37 @@ struct CustomSwitchButton: View { @Binding var IsOn: Bool // Image when Off - var imgNameIsOff: String - var imgIsOffWidth: CGFloat = 50 - var imgIsOffHeight: CGFloat = 50 + var imgSystemNameIsOff: String + var imgIsOffWidth: CGFloat = 25 + var imgIsOffHeight: CGFloat = 25 // Image when Off - var imgNameIsOn: String - var imgIsOnWidth: CGFloat = 50 - var imgIsOnHeight: CGFloat = 50 + var imgSystemNameIsOn: String + var imgIsOnWidth: CGFloat = 25 + var imgIsOnHeight: CGFloat = 25 var body: some View { HStack { - Image(imgNameIsOff) - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: imgIsOffWidth, height: imgIsOffHeight) + VStack { + if (!IsOn) { + Image(systemName: imgSystemNameIsOff) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: imgIsOffWidth, height: imgIsOffHeight) + } + }.frame(width: imgIsOffWidth, height: imgIsOffHeight) Toggle("isOn", isOn: $IsOn) .labelsHidden() - Image(imgNameIsOn) - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: imgIsOnWidth, height: imgIsOnHeight) + VStack { + if (IsOn) { + Image(systemName: imgSystemNameIsOn) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: imgIsOnWidth, height: imgIsOnHeight) + } + }.frame(width: imgIsOffWidth, height: imgIsOffHeight) } } } diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift index 27e0dee..dd90ddc 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift @@ -15,7 +15,7 @@ struct SettingsView: View { @State private var theme = false @State private var choice = "English" - @State private var sound = false + @State private var sound = true var body: some View { VStack { @@ -30,7 +30,7 @@ struct SettingsView: View { Spacer() - CustomSwitchButton(IsOn: $theme, imgNameIsOff: AppImages.TitleImage, imgNameIsOn: AppImages.TitleImage) + CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: "sun.max", imgSystemNameIsOn: "moon") } Divider() @@ -51,10 +51,13 @@ struct SettingsView: View { Divider() - VStack(alignment: .leading) { - Toggle("Sound", isOn: $sound) - .toggleStyle(.switch) + HStack { + Text("Theme") .font(.headline) + + Spacer() + + CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: "speaker.slash", imgSystemNameIsOn: "speaker.2") } Divider() From 4bc2b427aa28d4b5bd7859ebbb8e74b1a7be090b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 17:01:35 +0200 Subject: [PATCH 5/6] :sparkles: adding SystemIcons struct to contains name of system images --- .../DouShouQi_App/Assets/Images/SystemIcons.swift | 15 +++++++++++++++ .../DouShouQi_App/Views/Menu/SettingsView.swift | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift diff --git a/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift b/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift new file mode 100644 index 0000000..c948321 --- /dev/null +++ b/DouShouQi_App/DouShouQi_App/Assets/Images/SystemIcons.swift @@ -0,0 +1,15 @@ +// +// SystemIcons.swift +// DouShouQi_App +// +// Created by Rémi REGNAULT on 28/05/2024. +// + +import Foundation + +public struct SystemIcons { + static let DarkTheme = "moon" + static let LightTheme = "sun.max" + static let SoundOn = "speaker.2" + static let SoundOff = "speaker.slash" +} diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift index dd90ddc..dcdb387 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/SettingsView.swift @@ -30,7 +30,7 @@ struct SettingsView: View { Spacer() - CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: "sun.max", imgSystemNameIsOn: "moon") + CustomSwitchButton(IsOn: $theme, imgSystemNameIsOff: SystemIcons.LightTheme, imgSystemNameIsOn: SystemIcons.DarkTheme) } Divider() @@ -57,7 +57,7 @@ struct SettingsView: View { Spacer() - CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: "speaker.slash", imgSystemNameIsOn: "speaker.2") + CustomSwitchButton(IsOn: $sound, imgSystemNameIsOff: SystemIcons.SoundOff, imgSystemNameIsOn: SystemIcons.SoundOn) } Divider() From 18803a7114f72eba3a5e2950fb35d2bec027a2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Regnault?= Date: Tue, 28 May 2024 17:19:25 +0200 Subject: [PATCH 6/6] :bug: missing proj file in previous push --- .../DouShouQi_App.xcodeproj/project.pbxproj | 8 +- .../Views/Game/SwiftUIView.swift | 98 ------------------- 2 files changed, 4 insertions(+), 102 deletions(-) delete mode 100644 DouShouQi_App/DouShouQi_App/Views/Game/SwiftUIView.swift diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index 1407c7a..4340ad1 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -31,9 +31,9 @@ 649B59AE2BF64EAB002BAE38 /* AppImages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59AD2BF64EAB002BAE38 /* AppImages.swift */; }; 649B59B22BF65392002BAE38 /* TextStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59B12BF65392002BAE38 /* TextStyles.swift */; }; 649B59B42BF653E1002BAE38 /* ViewTitleTextStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 649B59B32BF653E1002BAE38 /* ViewTitleTextStyle.swift */; }; + 64D992722C06281B002ACBC6 /* SystemIcons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64D992712C06281B002ACBC6 /* SystemIcons.swift */; }; EC05BFC42C04C3C4000F7B19 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC05BFC32C04C3C4000F7B19 /* SettingsView.swift */; }; EC05BFC82C04D832000F7B19 /* CustomSwitchButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC05BFC72C04D832000F7B19 /* CustomSwitchButton.swift */; }; - EC62C4EF2BFE367F0048CD0B /* SwiftUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4EE2BFE367F0048CD0B /* SwiftUIView.swift */; }; EC62C4F92C0371660048CD0B /* MusicPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4F82C0371660048CD0B /* MusicPlayer.swift */; }; EC62C4FB2C038BD20048CD0B /* PlayersView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4FA2C038BD20048CD0B /* PlayersView.swift */; }; EC62C4FD2C0391D30048CD0B /* PlayerRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC62C4FC2C0391D30048CD0B /* PlayerRow.swift */; }; @@ -103,9 +103,9 @@ 649B59AD2BF64EAB002BAE38 /* AppImages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppImages.swift; sourceTree = ""; }; 649B59B12BF65392002BAE38 /* TextStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextStyles.swift; sourceTree = ""; }; 649B59B32BF653E1002BAE38 /* ViewTitleTextStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewTitleTextStyle.swift; sourceTree = ""; }; + 64D992712C06281B002ACBC6 /* SystemIcons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemIcons.swift; sourceTree = ""; }; EC05BFC32C04C3C4000F7B19 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; EC05BFC72C04D832000F7B19 /* CustomSwitchButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomSwitchButton.swift; sourceTree = ""; }; - EC62C4EE2BFE367F0048CD0B /* SwiftUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUIView.swift; sourceTree = ""; }; EC62C4F82C0371660048CD0B /* MusicPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicPlayer.swift; sourceTree = ""; }; EC62C4FA2C038BD20048CD0B /* PlayersView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayersView.swift; sourceTree = ""; }; EC62C4FC2C0391D30048CD0B /* PlayerRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerRow.swift; sourceTree = ""; }; @@ -154,7 +154,6 @@ isa = PBXGroup; children = ( 643AB69A2BFCFB5C0018DA73 /* HistoricView.swift */, - EC62C4EE2BFE367F0048CD0B /* SwiftUIView.swift */, ); path = Game; sourceTree = ""; @@ -296,6 +295,7 @@ children = ( 649B59AB2BF64E12002BAE38 /* Images.xcassets */, 649B59AD2BF64EAB002BAE38 /* AppImages.swift */, + 64D992712C06281B002ACBC6 /* SystemIcons.swift */, ); path = Images; sourceTree = ""; @@ -498,11 +498,11 @@ 649B59B42BF653E1002BAE38 /* ViewTitleTextStyle.swift in Sources */, EC62C5012C045B590048CD0B /* SoundPlayer.swift in Sources */, EC05BFC82C04D832000F7B19 /* CustomSwitchButton.swift in Sources */, + 64D992722C06281B002ACBC6 /* SystemIcons.swift in Sources */, 645B4C252BFCD3C600FD658A /* ScoreBoardView.swift in Sources */, 649B59AE2BF64EAB002BAE38 /* AppImages.swift in Sources */, 649ABF602BF60F2D002E8894 /* MainMenuButton.swift in Sources */, 643AB6932BFCEFD00018DA73 /* GameResumeFrame.swift in Sources */, - EC62C4EF2BFE367F0048CD0B /* SwiftUIView.swift in Sources */, 649B59B22BF65392002BAE38 /* TextStyles.swift in Sources */, EC62C5092C0467240048CD0B /* SplashScreenView.swift in Sources */, EC62C4F92C0371660048CD0B /* MusicPlayer.swift in Sources */, diff --git a/DouShouQi_App/DouShouQi_App/Views/Game/SwiftUIView.swift b/DouShouQi_App/DouShouQi_App/Views/Game/SwiftUIView.swift deleted file mode 100644 index e544d48..0000000 --- a/DouShouQi_App/DouShouQi_App/Views/Game/SwiftUIView.swift +++ /dev/null @@ -1,98 +0,0 @@ -// -// SwiftUIView.swift -// DouShouQi_App -// -// Created by étudiant on 22/05/2024. -// - -import SwiftUI - -struct SwiftUIView: View { - var body: some View { - VStack { - TitlePageFrame(Text: "DOU SHOU QI", ImageWidth: 200, ImageHeight: 200) - Spacer() - - VStack { - HStack{ - VStack { - Button(action: { - // Action du bouton - }, label: { - Text("Play".uppercased()) - .font(.headline) - .fontWeight(.semibold) - .foregroundColor(.white) - .frame(maxWidth: .infinity, maxHeight: 50) - .background( - Color.red - ) - .cornerRadius(0) - }) - .frame(width: UIScreen.main.bounds.width / 1.7) - .frame(maxWidth: .infinity, alignment: .leading) - - Button(action: { - // Action du bouton - }, label: { - Text("Historique".uppercased()) - .font(.headline) - .fontWeight(.semibold) - .foregroundColor(.white) - .frame(maxWidth: .infinity, maxHeight: 50) - .background( - Color.red - ) - .cornerRadius(0) - }) - .frame(width: UIScreen.main.bounds.width / 1.7) - .frame(maxWidth: .infinity, alignment: .leading) - - Button(action: { - // Action du bouton - }, label: { - Text("Best scores".uppercased()) - .font(.headline) - .fontWeight(.semibold) - .foregroundColor(.white) - .frame(maxWidth: .infinity, maxHeight: 50) - .background( - Color.red - ) - .cornerRadius(0) - }) - .frame(width: UIScreen.main.bounds.width / 1.7) - .frame(maxWidth: .infinity, alignment: .leading) - - Button(action: { - // Action du bouton - }, label: { - Text("Players".uppercased()) - .font(.headline) - .fontWeight(.semibold) - .foregroundColor(.white) - .frame(maxWidth: .infinity, maxHeight: 50) - .background( - Color.red - ) - .cornerRadius(0) - }) - .frame(width: UIScreen.main.bounds.width / 1.7) - .frame(maxWidth: .infinity, alignment: .leading) - } - .padding() - } - } - .padding(.horizontal, 10) - - Spacer() - } - } -} - - -struct SwiftUIView_Previews: PreviewProvider { - static var previews: some View { - SwiftUIView() - } -}