From a070dd3c54633ca421e1873e29e510bffd8778db Mon Sep 17 00:00:00 2001 From: Yashraj Date: Wed, 25 Oct 2023 11:56:00 +0530 Subject: [PATCH 1/3] Created an Onboarding Button --- .../Code/Common/Views/OnboardingButton.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift diff --git a/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift b/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift new file mode 100644 index 0000000..176f5d1 --- /dev/null +++ b/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift @@ -0,0 +1,18 @@ +// +// OnboardingButton.swift +// DailyTracker_UI +// +// Created by Yashraj jadhav on 24/10/23. +// + +import SwiftUI + +struct OnboardingButton: View { + var body: some View { + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } +} + +#Preview { + OnboardingButton() +} From 76f032c778e940646b766109e019e9275706c379 Mon Sep 17 00:00:00 2001 From: Yashraj Date: Wed, 25 Oct 2023 11:56:09 +0530 Subject: [PATCH 2/3] Create an Onboarding Button --- DailyTracker_UI.xcodeproj/project.pbxproj | 4 ++ .../Code/Common/Views/OnboardingButton.swift | 44 ++++++++++++++++++- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/DailyTracker_UI.xcodeproj/project.pbxproj b/DailyTracker_UI.xcodeproj/project.pbxproj index 681238e..aad012c 100644 --- a/DailyTracker_UI.xcodeproj/project.pbxproj +++ b/DailyTracker_UI.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ 51A901FB2AE3BC8800AEFEE6 /* DateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A901FA2AE3BC8800AEFEE6 /* DateManager.swift */; }; 51A901FE2AE3BCB800AEFEE6 /* TodayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A901FD2AE3BCB800AEFEE6 /* TodayView.swift */; }; 51A902012AE3C2AC00AEFEE6 /* MainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A902002AE3C2AC00AEFEE6 /* MainViewModel.swift */; }; + E57DF4072AE7E48300B56506 /* OnboardingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57DF4062AE7E48300B56506 /* OnboardingButton.swift */; }; E59FBB112ADAC664002B6F16 /* UserImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E59FBB102ADAC664002B6F16 /* UserImageView.swift */; }; /* End PBXBuildFile section */ @@ -53,6 +54,7 @@ 51A901FA2AE3BC8800AEFEE6 /* DateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateManager.swift; sourceTree = ""; }; 51A901FD2AE3BCB800AEFEE6 /* TodayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayView.swift; sourceTree = ""; }; 51A902002AE3C2AC00AEFEE6 /* MainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewModel.swift; sourceTree = ""; }; + E57DF4062AE7E48300B56506 /* OnboardingButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingButton.swift; sourceTree = ""; }; E59FBB102ADAC664002B6F16 /* UserImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserImageView.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -252,6 +254,7 @@ isa = PBXGroup; children = ( E59FBB102ADAC664002B6F16 /* UserImageView.swift */, + E57DF4062AE7E48300B56506 /* OnboardingButton.swift */, ); path = Views; sourceTree = ""; @@ -341,6 +344,7 @@ 51A902012AE3C2AC00AEFEE6 /* MainViewModel.swift in Sources */, 51A63E0C2AD1AE2400901E2B /* FoundationExtensions.swift in Sources */, 51A901F92AE3BC4900AEFEE6 /* FontManager.swift in Sources */, + E57DF4072AE7E48300B56506 /* OnboardingButton.swift in Sources */, 51A63DF22AD1ABD700901E2B /* Persistence.swift in Sources */, 51A63E122AD1B58E00901E2B /* UIApplicationExtension.swift in Sources */, 51A63DEB2AD1ABD600901E2B /* MainView.swift in Sources */, diff --git a/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift b/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift index 176f5d1..63c954a 100644 --- a/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift +++ b/DailyTracker_UI/iOS/Code/Common/Views/OnboardingButton.swift @@ -8,11 +8,51 @@ import SwiftUI struct OnboardingButton: View { + + @State private var from: CGFloat = 0.0 + @State private var to: CGFloat = 1.5 + + let color: Color + var body: some View { - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + Button(action: { + from += 0.5 + + }) { + ZStack { + Rectangle() + .stroke(color.opacity(0.07), lineWidth: 20) + .frame(width: 80, height: 80) + .cornerRadius(20.0) + .foregroundColor(.black) + .shadow(radius: 100) + + Rectangle() + .trim(from: 0, to: from / to) + .stroke(color, style: StrokeStyle(lineWidth: 25, lineCap: .square)) + .frame(width: 80, height: 80) + .cornerRadius(20.0) + .foregroundColor(.gray) + + Rectangle() + .frame(width: 70, height: 70) + .foregroundColor(.white) + .cornerRadius(20.0) + .shadow(radius: 10) + + Rectangle() + .frame(width: 60, height: 60) + .cornerRadius(15.0) + .foregroundColor(.black) + .shadow(radius: 10) + + Image(systemName: "chevron.right") + .foregroundColor(.white) + } + } } } #Preview { - OnboardingButton() + OnboardingButton(color: .black) } From 3ac07343a135f99e8dbe7c8a629f03ffdf0cd383 Mon Sep 17 00:00:00 2001 From: Yashraj Jadhav Date: Tue, 31 Oct 2023 18:38:54 +0530 Subject: [PATCH 3/3] Update project.pbxproj conflict resolved --- DailyTracker_UI.xcodeproj/project.pbxproj | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/DailyTracker_UI.xcodeproj/project.pbxproj b/DailyTracker_UI.xcodeproj/project.pbxproj index aad012c..084063f 100644 --- a/DailyTracker_UI.xcodeproj/project.pbxproj +++ b/DailyTracker_UI.xcodeproj/project.pbxproj @@ -27,7 +27,6 @@ 51A901FB2AE3BC8800AEFEE6 /* DateManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A901FA2AE3BC8800AEFEE6 /* DateManager.swift */; }; 51A901FE2AE3BCB800AEFEE6 /* TodayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A901FD2AE3BCB800AEFEE6 /* TodayView.swift */; }; 51A902012AE3C2AC00AEFEE6 /* MainViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A902002AE3C2AC00AEFEE6 /* MainViewModel.swift */; }; - E57DF4072AE7E48300B56506 /* OnboardingButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57DF4062AE7E48300B56506 /* OnboardingButton.swift */; }; E59FBB112ADAC664002B6F16 /* UserImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E59FBB102ADAC664002B6F16 /* UserImageView.swift */; }; /* End PBXBuildFile section */ @@ -54,8 +53,7 @@ 51A901FA2AE3BC8800AEFEE6 /* DateManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateManager.swift; sourceTree = ""; }; 51A901FD2AE3BCB800AEFEE6 /* TodayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodayView.swift; sourceTree = ""; }; 51A902002AE3C2AC00AEFEE6 /* MainViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewModel.swift; sourceTree = ""; }; - E57DF4062AE7E48300B56506 /* OnboardingButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingButton.swift; sourceTree = ""; }; - E59FBB102ADAC664002B6F16 /* UserImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserImageView.swift; sourceTree = ""; }; + /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -254,7 +252,6 @@ isa = PBXGroup; children = ( E59FBB102ADAC664002B6F16 /* UserImageView.swift */, - E57DF4062AE7E48300B56506 /* OnboardingButton.swift */, ); path = Views; sourceTree = ""; @@ -347,7 +344,6 @@ E57DF4072AE7E48300B56506 /* OnboardingButton.swift in Sources */, 51A63DF22AD1ABD700901E2B /* Persistence.swift in Sources */, 51A63E122AD1B58E00901E2B /* UIApplicationExtension.swift in Sources */, - 51A63DEB2AD1ABD600901E2B /* MainView.swift in Sources */, 51A63DE92AD1ABD600901E2B /* DailyTracker_UIApp.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0;