Skip to content

Commit

Permalink
Update the About screen and Updates screen with a 'leave a review' ca…
Browse files Browse the repository at this point in the history
…llout button
  • Loading branch information
r-token committed Apr 12, 2024
1 parent 2429492 commit 82631f2
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 103 deletions.
12 changes: 12 additions & 0 deletions CatchUp-SwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
F4BAD42D2B94E45D0009CD50 /* SelectedContact.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BAD42C2B94E45D0009CD50 /* SelectedContact.swift */; };
F4BAD42F2B94E8740009CD50 /* CatchUpApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BAD42E2B94E8740009CD50 /* CatchUpApp.swift */; };
F4BAD4312B94F5680009CD50 /* ModelContext+sqliteCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4BAD4302B94F5680009CD50 /* ModelContext+sqliteCommand.swift */; };
F4D5E68E2BC9F96E003E9F61 /* CalloutButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4D5E68D2BC9F96E003E9F61 /* CalloutButtonView.swift */; };
F4F7535D2BB0956800B20090 /* NextCatchUpsGridView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F7535C2BB0956800B20090 /* NextCatchUpsGridView.swift */; };
F4F7535F2BB0969A00B20090 /* ContactPictureView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F7535E2BB0969A00B20090 /* ContactPictureView.swift */; };
F4F753652BB11FA300B20090 /* View+if.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4F753642BB11FA300B20090 /* View+if.swift */; };
Expand Down Expand Up @@ -83,6 +84,7 @@
F4BAD42C2B94E45D0009CD50 /* SelectedContact.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedContact.swift; sourceTree = "<group>"; };
F4BAD42E2B94E8740009CD50 /* CatchUpApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatchUpApp.swift; sourceTree = "<group>"; };
F4BAD4302B94F5680009CD50 /* ModelContext+sqliteCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ModelContext+sqliteCommand.swift"; sourceTree = "<group>"; };
F4D5E68D2BC9F96E003E9F61 /* CalloutButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalloutButtonView.swift; sourceTree = "<group>"; };
F4F7535C2BB0956800B20090 /* NextCatchUpsGridView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NextCatchUpsGridView.swift; sourceTree = "<group>"; };
F4F7535E2BB0969A00B20090 /* ContactPictureView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactPictureView.swift; sourceTree = "<group>"; };
F4F753642BB11FA300B20090 /* View+if.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+if.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -110,6 +112,7 @@
F4AD59AF244CA12C00296568 /* AboutScreen.swift */,
14BE3AD62459F610004F72DE /* UpdatesScreen.swift */,
F435D4382BBB7B7800C43586 /* NoContactSelectedScreen.swift */,
F4D5E68C2BC9F956003E9F61 /* Multiscreen Subviews */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -233,6 +236,14 @@
path = Data;
sourceTree = "<group>";
};
F4D5E68C2BC9F956003E9F61 /* Multiscreen Subviews */ = {
isa = PBXGroup;
children = (
F4D5E68D2BC9F96E003E9F61 /* CalloutButtonView.swift */,
);
path = "Multiscreen Subviews";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -333,6 +344,7 @@
F4BAD42D2B94E45D0009CD50 /* SelectedContact.swift in Sources */,
F443F8162BC3745F00787A59 /* TimePickerRow.swift in Sources */,
F48E37F922C455C3008B0B8B /* HomeScreen.swift in Sources */,
F4D5E68E2BC9F96E003E9F61 /* CalloutButtonView.swift in Sources */,
F435D4312BB7E1D300C43586 /* NextCatchUpRow.swift in Sources */,
F435D4332BB8E7E700C43586 /* RemoveContactButton.swift in Sources */,
F435D4352BBA3EB100C43586 /* BirthdayOrAnniversaryRow.swift in Sources */,
Expand Down
8 changes: 8 additions & 0 deletions CatchUp-SwiftUI/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,12 @@ struct Utils {
static func isiPadOrMac() -> Bool {
return UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac
}

@MainActor
static func requestReviewManually() {
guard let writeReviewURL = URL(string: "https://apps.apple.com/us/app/catchup-keep-in-touch/id1358023550?action=write-review") else {
fatalError("Expected a valid URL")
}
UIApplication.shared.open(writeReviewURL, options: [:], completionHandler: nil)
}
}
174 changes: 88 additions & 86 deletions CatchUp-SwiftUI/Views/AboutScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,104 +16,106 @@ struct AboutScreen: View {
let largeTip = IAPService.shared.getLargeTipAmount()

var body: some View {
VStack(alignment: .center, spacing: 15) {
Spacer()
.frame(height: 100)

Group {
Image("CatchUp")
.resizable()
.frame(width: 80, height: 80)
.clipShape(RoundedRectangle(cornerRadius: 15))
.shadow(radius: 10)

Text("CatchUp")
.foregroundStyle(.orange)
.font(.largeTitle)
.bold()

Text("Made with ❤️ by an independent developer")
.multilineTextAlignment(.center)
.padding(.horizontal)

.padding(.bottom)

Divider()
.frame(height: 1)
.background(Color.orange)
ScrollView {
VStack(alignment: .center, spacing: 15) {
Spacer()
.frame(height: 75)

Group {
Image("CatchUp")
.resizable()
.frame(width: 80, height: 80)
.clipShape(RoundedRectangle(cornerRadius: 15))
.shadow(radius: 10)

Text("CatchUp")
.foregroundStyle(.orange)
.font(.largeTitle)
.bold()

Text("Made with ❤️ by an independent developer")
.multilineTextAlignment(.center)
.padding(.horizontal)

.padding(.bottom)

Text("Tip Jar")
.font(.headline)

Text("CatchUp is free with no ads. If you find it useful, please consider supporting development by leaving a tip.")
.multilineTextAlignment(.center)

.padding(.bottom)

HStack {

Spacer()

Button(smallTip) {
tappedSmallTip()
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()

Button(mediumTip) {
tappedMediumTip()

Divider()
.frame(height: 1)
.background(Color.orange)
.padding(.bottom)

Text("Tip Jar")
.font(.headline)

Text("CatchUp is free with no ads. If you find it useful, please consider supporting development by leaving a tip or review.")
.multilineTextAlignment(.center)
.padding(.bottom)

HStack {
Spacer()

Button(smallTip) {
tappedSmallTip()
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()

Button(mediumTip) {
tappedMediumTip()
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()

Button(largeTip) {
tappedLargeTip()
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()

Button(largeTip) {
tappedLargeTip()
.padding(.bottom, 20)

Divider()
.frame(height: 1)
.background(Color.orange)

Button {
Utils.requestReviewManually()
} label: {
CalloutButtonView(buttonText: "Review on the App Store", buttonColor: .orange)
}
.font(.headline)
.foregroundStyle(.white)
.padding()
.background(RoundedRectangle(cornerRadius: 20).fill(LinearGradient(gradient: Gradient(colors: [.orange, .red]), startPoint: .top, endPoint: .bottom))
)
.shadow(radius: 15)

Spacer()
.padding(.vertical)
}

.padding(.bottom)
.padding(.bottom)

Divider()
.frame(height: 1)
.background(Color.orange)

Spacer()
}

Group {

Button {
isShowingUpdateScreen = true
} label: {
Text("Show Latest Update Details")
.font(.headline)
.foregroundStyle(.blue)
}
.padding(.bottom)
}
}
.padding()
}
.padding(.horizontal)

.sheet(isPresented: $isShowingUpdateScreen) {
UpdatesScreen()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,7 @@ struct RemoveContactButton: View {
Button {
isShowingDeleteContactAlert = true
} label: {
HStack {
Spacer()

Text("Remove \(contact.name)")

Spacer()
}
.fontWeight(.semibold)
.padding(.vertical, 12)
.foregroundStyle(.white)
.background(
RoundedRectangle(
cornerRadius: 20,
style: .continuous
)
.fill(.red)
)
CalloutButtonView(buttonText: "Remove \(contact.name)", buttonColor: .red)
}
.listRowBackground(Color.clear)

Expand Down
38 changes: 38 additions & 0 deletions CatchUp-SwiftUI/Views/Multiscreen Subviews/CalloutButtonView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// CalloutButtonView.swift
// CatchUp-SwiftUI
//
// Created by Ryan Token on 4/12/24.
// Copyright © 2024 Token Solutions. All rights reserved.
//

import SwiftUI

struct CalloutButtonView: View {
let buttonText: String
let buttonColor: Color

var body: some View {
HStack {
Spacer()

Text(buttonText)

Spacer()
}
.fontWeight(.semibold)
.padding(.vertical, 12)
.foregroundStyle(.white)
.background(
RoundedRectangle(
cornerRadius: 20,
style: .continuous
)
.fill(buttonColor)
)
}
}

#Preview {
CalloutButtonView(buttonText: "Remove Bee", buttonColor: .red)
}
16 changes: 16 additions & 0 deletions CatchUp-SwiftUI/Views/UpdatesScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ struct UpdatesScreen: View {
}

Group {
Text("– New **Quarterly** and **Annually** notification options")

Spacer()

Text("***From version 3.0***:")
.padding(.top)

Spacer()

Text("– A grid of your next CatchUps")

Spacer()
Expand All @@ -57,6 +66,13 @@ struct UpdatesScreen: View {
}

Spacer()

Button {
Utils.requestReviewManually()
} label: {
CalloutButtonView(buttonText: "Review on the App Store", buttonColor: .orange)
}
.padding(.vertical)
}
}
.padding([.top, .horizontal])
Expand Down

0 comments on commit 82631f2

Please sign in to comment.