From a18750d6af40aca8503285c843de44780248c60a Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 00:00:14 +0300 Subject: [PATCH 01/10] Create OnboardingView --- FlipTimer.xcodeproj/project.pbxproj | 4 +++ FlipTimer/Views/OnboardingView.swift | 54 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 FlipTimer/Views/OnboardingView.swift diff --git a/FlipTimer.xcodeproj/project.pbxproj b/FlipTimer.xcodeproj/project.pbxproj index 9bc0a7a..6bb7297 100644 --- a/FlipTimer.xcodeproj/project.pbxproj +++ b/FlipTimer.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 370D194525800A00000FAA08 /* PrimaryButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */; }; 370D195225802FD0000FAA08 /* TimerLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D195125802FD0000FAA08 /* TimerLength.swift */; }; + 3732B7D12584102A00F72F79 /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3732B7D02584102A00F72F79 /* OnboardingView.swift */; }; 374A674025791BAA00F56C72 /* FlipTimerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374A673F25791BAA00F56C72 /* FlipTimerApp.swift */; }; 374A674225791BAA00F56C72 /* TimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374A674125791BAA00F56C72 /* TimerView.swift */; }; 374A674425791BAB00F56C72 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 374A674325791BAB00F56C72 /* Assets.xcassets */; }; @@ -22,6 +23,7 @@ /* Begin PBXFileReference section */ 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButtonStyle.swift; sourceTree = ""; }; 370D195125802FD0000FAA08 /* TimerLength.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerLength.swift; sourceTree = ""; }; + 3732B7D02584102A00F72F79 /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = ""; }; 374A673C25791BAA00F56C72 /* FlipTimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlipTimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 374A673F25791BAA00F56C72 /* FlipTimerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlipTimerApp.swift; sourceTree = ""; }; 374A674125791BAA00F56C72 /* TimerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerView.swift; sourceTree = ""; }; @@ -52,6 +54,7 @@ 374A674125791BAA00F56C72 /* TimerView.swift */, 3783EA58257991470058C69E /* SettingsView.swift */, 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */, + 3732B7D02584102A00F72F79 /* OnboardingView.swift */, ); path = Views; sourceTree = ""; @@ -185,6 +188,7 @@ 370D194525800A00000FAA08 /* PrimaryButtonStyle.swift in Sources */, 3783EA59257991470058C69E /* SettingsView.swift in Sources */, 370D195225802FD0000FAA08 /* TimerLength.swift in Sources */, + 3732B7D12584102A00F72F79 /* OnboardingView.swift in Sources */, 37BC0AB9257ABE5900238884 /* TimerViewModel.swift in Sources */, 37A33CBA257C19A2003F2B96 /* TimerMode.swift in Sources */, 374A674225791BAA00F56C72 /* TimerView.swift in Sources */, diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift new file mode 100644 index 0000000..f9ebe68 --- /dev/null +++ b/FlipTimer/Views/OnboardingView.swift @@ -0,0 +1,54 @@ +// +// OnboardingView.swift +// FlipTimer +// +// Created by Dan on 11/12/2020. +// + +import SwiftUI + +struct OnboardingView: View { + var body: some View { + VStack { + Spacer() + + Text("Welcome to Flip Timer") + .font(.largeTitle) + .fontWeight(.bold) + .multilineTextAlignment(.center) + .padding() + + Spacer() + + VStack(spacing: 24) { + Text("1") + Text("2") + Text("3") + } + + // TODO: find out if spacers can have weight + Spacer() + Spacer() + + Button(action: {}, label: { + HStack { + Spacer() + Text("Continue") + .font(.headline) + .foregroundColor(.white) + Spacer() + } + .padding() + .background(Color.blue) + .cornerRadius(12) + }) + } + .padding() + } +} + +struct OnboardingView_Previews: PreviewProvider { + static var previews: some View { + OnboardingView() + } +} From 7c0354b60e8f85a64a635153cd9f09ac8ffcd6b0 Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 00:08:05 +0300 Subject: [PATCH 02/10] Add FeatureCell --- FlipTimer.xcodeproj/project.pbxproj | 4 +++ FlipTimer/Views/FeatureCell.swift | 45 +++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 FlipTimer/Views/FeatureCell.swift diff --git a/FlipTimer.xcodeproj/project.pbxproj b/FlipTimer.xcodeproj/project.pbxproj index 6bb7297..c4769cf 100644 --- a/FlipTimer.xcodeproj/project.pbxproj +++ b/FlipTimer.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 370D194525800A00000FAA08 /* PrimaryButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */; }; 370D195225802FD0000FAA08 /* TimerLength.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D195125802FD0000FAA08 /* TimerLength.swift */; }; 3732B7D12584102A00F72F79 /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3732B7D02584102A00F72F79 /* OnboardingView.swift */; }; + 3732B7D42584158C00F72F79 /* FeatureCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3732B7D32584158C00F72F79 /* FeatureCell.swift */; }; 374A674025791BAA00F56C72 /* FlipTimerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374A673F25791BAA00F56C72 /* FlipTimerApp.swift */; }; 374A674225791BAA00F56C72 /* TimerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 374A674125791BAA00F56C72 /* TimerView.swift */; }; 374A674425791BAB00F56C72 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 374A674325791BAB00F56C72 /* Assets.xcassets */; }; @@ -24,6 +25,7 @@ 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButtonStyle.swift; sourceTree = ""; }; 370D195125802FD0000FAA08 /* TimerLength.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerLength.swift; sourceTree = ""; }; 3732B7D02584102A00F72F79 /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = ""; }; + 3732B7D32584158C00F72F79 /* FeatureCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureCell.swift; sourceTree = ""; }; 374A673C25791BAA00F56C72 /* FlipTimer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FlipTimer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 374A673F25791BAA00F56C72 /* FlipTimerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlipTimerApp.swift; sourceTree = ""; }; 374A674125791BAA00F56C72 /* TimerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerView.swift; sourceTree = ""; }; @@ -55,6 +57,7 @@ 3783EA58257991470058C69E /* SettingsView.swift */, 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */, 3732B7D02584102A00F72F79 /* OnboardingView.swift */, + 3732B7D32584158C00F72F79 /* FeatureCell.swift */, ); path = Views; sourceTree = ""; @@ -193,6 +196,7 @@ 37A33CBA257C19A2003F2B96 /* TimerMode.swift in Sources */, 374A674225791BAA00F56C72 /* TimerView.swift in Sources */, 374A674025791BAA00F56C72 /* FlipTimerApp.swift in Sources */, + 3732B7D42584158C00F72F79 /* FeatureCell.swift in Sources */, 37C155702581353B000349BA /* SettingsViewModel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/FlipTimer/Views/FeatureCell.swift b/FlipTimer/Views/FeatureCell.swift new file mode 100644 index 0000000..d806b6c --- /dev/null +++ b/FlipTimer/Views/FeatureCell.swift @@ -0,0 +1,45 @@ +// +// FeatureCell.swift +// FlipTimer +// +// Created by Dan on 12/12/2020. +// + +import SwiftUI + +struct FeatureCell: View { + var imageName: String + var title: String + var subtitle: String + + var body: some View { + HStack(spacing: 24) { + Image(systemName: imageName) + .resizable() + .aspectRatio(contentMode: .fit) + .frame(width: 32) + .foregroundColor(.blue) + + VStack(alignment: .leading, content: { + Text(title) + .font(.subheadline) + .fontWeight(.semibold) + Text(subtitle) + .foregroundColor(.secondary) + .font(.subheadline) + }) + + Spacer() + } + } +} + +struct FeatureCell_Previews: PreviewProvider { + static var previews: some View { + FeatureCell( + imageName: "text.badge.checkmark", + title: "Title", + subtitle: "Subtitle" + ) + } +} From 649200acb7285492fb6de0979bdea0de94f0c538 Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 00:08:45 +0300 Subject: [PATCH 03/10] Use FeatureCell in OnboardingView --- FlipTimer/Views/OnboardingView.swift | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index f9ebe68..8161a8a 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -21,9 +21,21 @@ struct OnboardingView: View { Spacer() VStack(spacing: 24) { - Text("1") - Text("2") - Text("3") + FeatureCell( + imageName: "text.badge.checkmark", + title: "Title", + subtitle: "Subtitle" + ) + FeatureCell( + imageName: "text.badge.checkmark", + title: "Title", + subtitle: "Subtitle" + ) + FeatureCell( + imageName: "text.badge.checkmark", + title: "Title", + subtitle: "Subtitle" + ) } // TODO: find out if spacers can have weight From 6a59364a8eb49c884c31f9f23d0d8bddc78ca558 Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 00:13:20 +0300 Subject: [PATCH 04/10] Fix alignment, add spacing --- FlipTimer/Views/FeatureCell.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FlipTimer/Views/FeatureCell.swift b/FlipTimer/Views/FeatureCell.swift index d806b6c..ab3eb08 100644 --- a/FlipTimer/Views/FeatureCell.swift +++ b/FlipTimer/Views/FeatureCell.swift @@ -13,14 +13,14 @@ struct FeatureCell: View { var subtitle: String var body: some View { - HStack(spacing: 24) { + HStack(alignment: .top, spacing: 24) { Image(systemName: imageName) .resizable() .aspectRatio(contentMode: .fit) .frame(width: 32) .foregroundColor(.blue) - VStack(alignment: .leading, content: { + VStack(alignment: .leading, spacing: 4, content: { Text(title) .font(.subheadline) .fontWeight(.semibold) @@ -38,8 +38,8 @@ struct FeatureCell_Previews: PreviewProvider { static var previews: some View { FeatureCell( imageName: "text.badge.checkmark", - title: "Title", - subtitle: "Subtitle" + title: "Some Feature", + subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ) } } From 135ebf6ed4fc9284230af928db87a870f6a3b9d1 Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 00:13:26 +0300 Subject: [PATCH 05/10] Add sample features --- FlipTimer/Views/OnboardingView.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index 8161a8a..157b78c 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -12,7 +12,7 @@ struct OnboardingView: View { VStack { Spacer() - Text("Welcome to Flip Timer") + Text("Welcome to\nFlip Timer!") .font(.largeTitle) .fontWeight(.bold) .multilineTextAlignment(.center) @@ -23,18 +23,18 @@ struct OnboardingView: View { VStack(spacing: 24) { FeatureCell( imageName: "text.badge.checkmark", - title: "Title", - subtitle: "Subtitle" + title: "Feature 1", + subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ) FeatureCell( imageName: "text.badge.checkmark", - title: "Title", - subtitle: "Subtitle" + title: "Feature 2", + subtitle: "Maecenas a posuere nunc. Morbi faucibus, massa eget vehicula." ) FeatureCell( imageName: "text.badge.checkmark", - title: "Title", - subtitle: "Subtitle" + title: "Feature 3", + subtitle: "Etiam non pellentesque ligula. Aenean eleifend erat tincidunt." ) } From 6e5c184d1aa5a67d3f14548418b859b204539cac Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 01:00:13 +0300 Subject: [PATCH 06/10] Add padding --- FlipTimer/Views/OnboardingView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index 157b78c..96f12d5 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -37,6 +37,7 @@ struct OnboardingView: View { subtitle: "Etiam non pellentesque ligula. Aenean eleifend erat tincidunt." ) } + .padding() // TODO: find out if spacers can have weight Spacer() From e143d221a4e4b209bb41fb4e01e01c669ddb893a Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 01:00:21 +0300 Subject: [PATCH 07/10] Present OnboardingView --- FlipTimer/Views/TimerView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FlipTimer/Views/TimerView.swift b/FlipTimer/Views/TimerView.swift index f1c48fd..4409a4e 100644 --- a/FlipTimer/Views/TimerView.swift +++ b/FlipTimer/Views/TimerView.swift @@ -53,6 +53,9 @@ struct TimerView: View { .sheet(isPresented: $viewModel.shouldPresentSettingsView, content: { SettingsView(showSettingsView: $viewModel.shouldPresentSettingsView) }) + .sheet(isPresented: .constant(true), content: { + OnboardingView() + }) .actionSheet(isPresented: $viewModel.shouldOpenTimerLengthPicker, content: { var buttons = TimerLength.allCases.map { length in ActionSheet.Button.default(Text(length.name)) { From b87d3ec87e0727d70d149ea6b52385aeca63968c Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 01:03:44 +0300 Subject: [PATCH 08/10] Remove copyright comments --- FlipTimer/Views/FeatureCell.swift | 7 ------- FlipTimer/Views/OnboardingView.swift | 7 ------- 2 files changed, 14 deletions(-) diff --git a/FlipTimer/Views/FeatureCell.swift b/FlipTimer/Views/FeatureCell.swift index ab3eb08..7b06cb6 100644 --- a/FlipTimer/Views/FeatureCell.swift +++ b/FlipTimer/Views/FeatureCell.swift @@ -1,10 +1,3 @@ -// -// FeatureCell.swift -// FlipTimer -// -// Created by Dan on 12/12/2020. -// - import SwiftUI struct FeatureCell: View { diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index 96f12d5..6b01d49 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -1,10 +1,3 @@ -// -// OnboardingView.swift -// FlipTimer -// -// Created by Dan on 11/12/2020. -// - import SwiftUI struct OnboardingView: View { From 07da1c02b2cc72399868a16e304bd8272db4837e Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 01:51:49 +0300 Subject: [PATCH 09/10] Add ContentView, present onboarding in ContentView --- FlipTimer.xcodeproj/project.pbxproj | 4 ++++ FlipTimer/FlipTimerApp.swift | 2 +- FlipTimer/Views/ContentView.swift | 19 ++++++++++++++++++ FlipTimer/Views/OnboardingView.swift | 30 +++++++++++++++++----------- FlipTimer/Views/TimerView.swift | 5 +---- 5 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 FlipTimer/Views/ContentView.swift diff --git a/FlipTimer.xcodeproj/project.pbxproj b/FlipTimer.xcodeproj/project.pbxproj index c4769cf..901d45d 100644 --- a/FlipTimer.xcodeproj/project.pbxproj +++ b/FlipTimer.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 374A674725791BAB00F56C72 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 374A674625791BAB00F56C72 /* Preview Assets.xcassets */; }; 3783EA59257991470058C69E /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3783EA58257991470058C69E /* SettingsView.swift */; }; 37A33CBA257C19A2003F2B96 /* TimerMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37A33CB9257C19A2003F2B96 /* TimerMode.swift */; }; + 37ACBD9F25842D0000AD7702 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37ACBD9E25842D0000AD7702 /* ContentView.swift */; }; 37BC0AB9257ABE5900238884 /* TimerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37BC0AB8257ABE5900238884 /* TimerViewModel.swift */; }; 37C155702581353B000349BA /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C1556F2581353B000349BA /* SettingsViewModel.swift */; }; /* End PBXBuildFile section */ @@ -34,6 +35,7 @@ 374A674825791BAB00F56C72 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 3783EA58257991470058C69E /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 37A33CB9257C19A2003F2B96 /* TimerMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerMode.swift; sourceTree = ""; }; + 37ACBD9E25842D0000AD7702 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 37BC0AB8257ABE5900238884 /* TimerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimerViewModel.swift; sourceTree = ""; }; 37BEE116257ADD3F00F1F787 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 37C1556F2581353B000349BA /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = ""; }; @@ -58,6 +60,7 @@ 370D194425800A00000FAA08 /* PrimaryButtonStyle.swift */, 3732B7D02584102A00F72F79 /* OnboardingView.swift */, 3732B7D32584158C00F72F79 /* FeatureCell.swift */, + 37ACBD9E25842D0000AD7702 /* ContentView.swift */, ); path = Views; sourceTree = ""; @@ -189,6 +192,7 @@ buildActionMask = 2147483647; files = ( 370D194525800A00000FAA08 /* PrimaryButtonStyle.swift in Sources */, + 37ACBD9F25842D0000AD7702 /* ContentView.swift in Sources */, 3783EA59257991470058C69E /* SettingsView.swift in Sources */, 370D195225802FD0000FAA08 /* TimerLength.swift in Sources */, 3732B7D12584102A00F72F79 /* OnboardingView.swift in Sources */, diff --git a/FlipTimer/FlipTimerApp.swift b/FlipTimer/FlipTimerApp.swift index 8239c5d..4bc85de 100644 --- a/FlipTimer/FlipTimerApp.swift +++ b/FlipTimer/FlipTimerApp.swift @@ -4,7 +4,7 @@ import SwiftUI struct FlipTimerApp: App { var body: some Scene { WindowGroup { - TimerView() + ContentView() } } } diff --git a/FlipTimer/Views/ContentView.swift b/FlipTimer/Views/ContentView.swift new file mode 100644 index 0000000..1910f68 --- /dev/null +++ b/FlipTimer/Views/ContentView.swift @@ -0,0 +1,19 @@ +import SwiftUI + +struct ContentView: View { + @AppStorage("onboardingDismissed") private var onboardingDismissed = false + + var body: some View { + if onboardingDismissed { + TimerView() + } else { + OnboardingView() + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index 6b01d49..a737069 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -1,6 +1,8 @@ import SwiftUI struct OnboardingView: View { + @AppStorage("onboardingDismissed") private var onboardingDismissed = false + var body: some View { VStack { Spacer() @@ -36,18 +38,22 @@ struct OnboardingView: View { Spacer() Spacer() - Button(action: {}, label: { - HStack { - Spacer() - Text("Continue") - .font(.headline) - .foregroundColor(.white) - Spacer() - } - .padding() - .background(Color.blue) - .cornerRadius(12) - }) + Button( + action: { + onboardingDismissed = true + }, + label: { + HStack { + Spacer() + Text("Continue") + .font(.headline) + .foregroundColor(.white) + Spacer() + } + .padding() + .background(Color.blue) + .cornerRadius(12) + }) } .padding() } diff --git a/FlipTimer/Views/TimerView.swift b/FlipTimer/Views/TimerView.swift index 4409a4e..b6ddb1c 100644 --- a/FlipTimer/Views/TimerView.swift +++ b/FlipTimer/Views/TimerView.swift @@ -53,9 +53,6 @@ struct TimerView: View { .sheet(isPresented: $viewModel.shouldPresentSettingsView, content: { SettingsView(showSettingsView: $viewModel.shouldPresentSettingsView) }) - .sheet(isPresented: .constant(true), content: { - OnboardingView() - }) .actionSheet(isPresented: $viewModel.shouldOpenTimerLengthPicker, content: { var buttons = TimerLength.allCases.map { length in ActionSheet.Button.default(Text(length.name)) { @@ -83,7 +80,7 @@ struct TimerView: View { } } -struct ContentView_Previews: PreviewProvider { +struct TimerView_Previews: PreviewProvider { static var previews: some View { Group { TimerView() From 6970e5a7a30579354e259c16c7050f49b62e219d Mon Sep 17 00:00:00 2001 From: Dan Kim Date: Sat, 12 Dec 2020 14:43:03 +0300 Subject: [PATCH 10/10] Update onboarding text --- FlipTimer/Views/OnboardingView.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FlipTimer/Views/OnboardingView.swift b/FlipTimer/Views/OnboardingView.swift index a737069..2ee6eb9 100644 --- a/FlipTimer/Views/OnboardingView.swift +++ b/FlipTimer/Views/OnboardingView.swift @@ -17,19 +17,19 @@ struct OnboardingView: View { VStack(spacing: 24) { FeatureCell( - imageName: "text.badge.checkmark", - title: "Feature 1", - subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + imageName: "hourglass", + title: "Timer Interval", + subtitle: "Tap on the timer label and choose your timer length." ) FeatureCell( - imageName: "text.badge.checkmark", - title: "Feature 2", - subtitle: "Maecenas a posuere nunc. Morbi faucibus, massa eget vehicula." + imageName: "arrow.turn.right.down", + title: "No Screen Time", + subtitle: "Put your device on the table screen facing down to start the timer." ) FeatureCell( - imageName: "text.badge.checkmark", - title: "Feature 3", - subtitle: "Etiam non pellentesque ligula. Aenean eleifend erat tincidunt." + imageName: "speaker.wave.2.fill", + title: "Take a Break", + subtitle: "You will hear a sound when the timer is finished. Take a break and restart when you're ready!" ) } .padding()