Skip to content

Commit 90234bc

Browse files
authored
Merge pull request #241 from cocoatype/213-update-onboarding
Update onboarding
2 parents 968191e + fa1b503 commit 90234bc

File tree

13 files changed

+98
-61
lines changed

13 files changed

+98
-61
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "Paywall Onboarding.png",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"filename" : "Paywall Onboarding@2x.png",
10+
"idiom" : "universal",
11+
"scale" : "2x"
12+
},
13+
{
14+
"filename" : "Paywall Onboarding@3x.png",
15+
"idiom" : "universal",
16+
"scale" : "3x"
17+
}
18+
],
19+
"info" : {
20+
"author" : "xcode",
21+
"version" : 1
22+
}
23+
}
32.9 KB
Loading
97.6 KB
Loading
187 KB
Loading

Modules/Onboarding/Resources/en.lproj/Localizable.strings

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
"AddPage.headline" = "Add";
33

44
// Body for the add page
5-
"AddPage.body%@%@" = "You can add barcodes to Barc by entering them manually by tapping the %@ button, or scanning them by tapping the %@ button.
6-
7-
Scanning for barcodes requires permission to access your phone’s camera. If you prefer not to grant this permission, other methods of adding barcodes will still be available.";
5+
"AddPage.body%@%@" = "You can add barcodes to Barc by entering them manually by tapping the %@ button, or scanning them by tapping the %@ button.";
86

97
// Headline for the add page
108
"ImportPage.headline" = "Import";
119

1210
// Body for the add page
1311
"ImportPage.body%@" = "You can import barcodes from other apps by sharing them or taking a screenshot.
1412

15-
Try it now! Take a screenshot of this page. Next, tap the screenshot preview in the lower-left. On the page that appears, tap the %@ button. Then, find Barc in the menu it brings up (it may be in the “More” menu at the end of the list). Tapping the Barc icon will add this code to Barc.";
13+
Try it now! Take a screenshot of this page, and send it to the Barc app. (Barc may be in the “More” menu at the end of the list)";
1614

1715
// Headline for the intro page
1816
"IntroPage.headline" = "Welcome to Barc.";
@@ -32,16 +30,28 @@ Either way, I hope you have a great time using Barc! If you have any questions o
3230
// Title for the button on the intro page that starts onboarding.
3331
"IntroPage.startButtonTitle" = "Get Started";
3432

33+
// Headline for the paywall page
34+
"PaywallPage.headline" = "Unleash";
35+
36+
// Primary button for the paywall page
37+
"PaywallPage.primaryButtonTitle" = "Learn More";
38+
39+
// Secondary button for the paywall page
40+
"PaywallPage.secondaryButtonTitle" = "Not Yet";
41+
42+
// Body for the paywall page
43+
"PaywallPage.body%@" = "Unlock unlimited barcodes and Apple Wallet support. Keep all of the barcodes you have, wherever you want them.
44+
45+
As an indie developer, I built Barc to be the barcode app that I would use myself. Your support helps me keep making it better.";
46+
3547
// Title for the button on all standard pages that continues onboarding.
3648
"StandardPage.continueButtonTitle" = "Continue";
3749

3850
// Headline for the add page
3951
"TagPage.headline" = "Tag";
4052

4153
// Body for the add page
42-
"TagPage.body" = "After adding a code, give it a name to help you remember it later. You can also add relevant places and dates to barcodes to let Barc know when best to show them to you.
43-
44-
Using places to surface barcodes requires permission to access your location. If you prefer not to grant this permission, you can still use dates to help show barcodes when they’re important.";
54+
"TagPage.body" = "After adding a code, give it a name to help you remember it later. You can also add relevant places and dates to barcodes to let Barc know when best to show them to you.";
4555

4656
// Headline for the add page
4757
"ViewPage.headline" = "Fetch";

Modules/Onboarding/Sources/Advancement/PaywallAction.swift

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

Modules/Onboarding/Sources/OnboardingView.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@ public struct OnboardingView: View {
1818
case .tag: TagPage()
1919
case .import: ImportPage()
2020
case .view: ViewPage()
21-
case .paywall: PaywallView()
21+
case .paywall: PaywallPage()
2222
}
2323
}.environment(\.advance, AdvanceAction {
2424
guard let nextPage = currentPage.next else { return dismiss() }
2525
currentPage = nextPage
26-
}).environment(\.paywall, PaywallAction {
27-
currentPage = .paywall
2826
})
2927
}
3028
}

Modules/Onboarding/Sources/Pages/AddPage.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@ import Permission
55
import SwiftUI
66

77
struct AddPage: View {
8-
private let requester = Permission.cameraPermissionRequester
98
var body: some View {
109
StandardPage(
1110
imageLight: Asset.addOnboarding.swiftUIImage,
1211
imageDark: Asset.addOnboardingDark.swiftUIImage,
1312
headline: OnboardingStrings.AddPage.headline,
1413
message: LocalizedStringKey("AddPage.body\(Image(systemName: "plus"))\(Image(systemName: "barcode.viewfinder"))"),
1514
pageIndex: 0
16-
) {
17-
_ = await requester.requestPermission()
18-
}
15+
)
1916
}
2017
}
2118

Modules/Onboarding/Sources/Pages/IntroPage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import SwiftUI
55

66
struct IntroPage: View {
7-
@Environment(\.paywall) private var paywall
7+
@Environment(\.dismiss) private var dismiss
88
@Environment(\.advance) private var advance
99

1010
var body: some View {
@@ -16,7 +16,7 @@ struct IntroPage: View {
1616
)
1717
Spacer()
1818
HStack(spacing: 16) {
19-
SecondaryButton(title: Strings.skipButtonTitle) { paywall() }
19+
SecondaryButton(title: Strings.skipButtonTitle) { dismiss() }
2020
PrimaryButton(title: Strings.startButtonTitle) { advance() }
2121
}
2222
.padding(.horizontal, 32)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Created by Geoff Pado on 12/23/24.
2+
// Copyright © 2024 Cocoatype, LLC. All rights reserved.
3+
4+
import Paywall
5+
import SwiftUI
6+
7+
struct PaywallPage: View {
8+
@Environment(\.dismiss) private var dismiss
9+
@State private var isShowingPaywall = false
10+
var body: some View {
11+
VStack {
12+
ScrollIfNecessary {
13+
VStack {
14+
Asset.paywallOnboarding.swiftUIImage
15+
.padding(.top, 16)
16+
TextStack(
17+
headline: OnboardingStrings.PaywallPage.headline,
18+
message: OnboardingStrings.PaywallPage.body
19+
)
20+
}
21+
}
22+
Spacer()
23+
VStack {
24+
HStack(spacing: 16) {
25+
SecondaryButton(title: OnboardingStrings.PaywallPage.secondaryButtonTitle) {
26+
dismiss()
27+
}
28+
PrimaryButton(title: OnboardingStrings.PaywallPage.primaryButtonTitle) {
29+
isShowingPaywall = true
30+
}
31+
}
32+
.padding(.horizontal, 32)
33+
.padding(.bottom, 16)
34+
}
35+
}
36+
.sheet(isPresented: $isShowingPaywall) {
37+
dismiss()
38+
} content: {
39+
PaywallView()
40+
}
41+
}
42+
}
43+
44+
#Preview {
45+
PaywallPage()
46+
}

0 commit comments

Comments
 (0)