Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CoffeeTracker/CoffeeTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
3782E03527C4AA81000F0404 /* BeansCollectionViewOO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3782E03427C4AA81000F0404 /* BeansCollectionViewOO.swift */; };
3797E1C427D6A52F000FE457 /* View+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3797E1C327D6A52F000FE457 /* View+Extensions.swift */; };
3797E1C627D6A6F3000FE457 /* Color+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3797E1C527D6A6F3000FE457 /* Color+Extension.swift */; };
379E1CBF27E8BF7C004101E0 /* ShareApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 379E1CBE27E8BF7C004101E0 /* ShareApp.swift */; };
37B776A627C67A6F00EFD566 /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37B776A527C67A6F00EFD566 /* CloudKit.framework */; };
37C9838427E4E4D4007C85E3 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C9838327E4E4D4007C85E3 /* Constants.swift */; };
37C9838727E4E5B8007C85E3 /* RevenueCat in Frameworks */ = {isa = PBXBuildFile; productRef = 37C9838627E4E5B8007C85E3 /* RevenueCat */; };
37DD41CB27EA789300BEF00A /* ActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DD41CA27EA789300BEF00A /* ActivityView.swift */; };
37F18B2827E4C09500F609DF /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37F18B2727E4C09500F609DF /* AboutView.swift */; };
37F18B2A27E4C15200F609DF /* BuyDevCoffeeSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37F18B2927E4C15200F609DF /* BuyDevCoffeeSection.swift */; };
/* End PBXBuildFile section */
Expand All @@ -55,10 +57,12 @@
3782E03427C4AA81000F0404 /* BeansCollectionViewOO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeansCollectionViewOO.swift; sourceTree = "<group>"; };
3797E1C327D6A52F000FE457 /* View+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extensions.swift"; sourceTree = "<group>"; };
3797E1C527D6A6F3000FE457 /* Color+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+Extension.swift"; sourceTree = "<group>"; };
379E1CBE27E8BF7C004101E0 /* ShareApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareApp.swift; sourceTree = "<group>"; };
37B776A327C67A6B00EFD566 /* CoffeeTracker.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = CoffeeTracker.entitlements; sourceTree = "<group>"; };
37B776A527C67A6F00EFD566 /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; };
37B776A727C67A7800EFD566 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
37C9838327E4E4D4007C85E3 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
37DD41CA27EA789300BEF00A /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = "<group>"; };
37F18B2727E4C09500F609DF /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };
37F18B2927E4C15200F609DF /* BuyDevCoffeeSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuyDevCoffeeSection.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -97,6 +101,7 @@
371E294D27C40D2100C8ACBF /* CoffeeTracker */ = {
isa = PBXGroup;
children = (
37DD41C927EA788100BEF00A /* Components */,
37F18B2627E4C08500F609DF /* About */,
376A5E5127D844BF0038BDA0 /* PhotoPicker */,
37B776A727C67A7800EFD566 /* Info.plist */,
Expand Down Expand Up @@ -171,12 +176,21 @@
name = Frameworks;
sourceTree = "<group>";
};
37DD41C927EA788100BEF00A /* Components */ = {
isa = PBXGroup;
children = (
37DD41CA27EA789300BEF00A /* ActivityView.swift */,
);
path = Components;
sourceTree = "<group>";
};
37F18B2627E4C08500F609DF /* About */ = {
isa = PBXGroup;
children = (
37F18B2727E4C09500F609DF /* AboutView.swift */,
37F18B2927E4C15200F609DF /* BuyDevCoffeeSection.swift */,
3776B9E027E8B3450042C494 /* UserFeedback.swift */,
379E1CBE27E8BF7C004101E0 /* ShareApp.swift */,
);
path = About;
sourceTree = "<group>";
Expand Down Expand Up @@ -268,7 +282,9 @@
376A5E5327D844D60038BDA0 /* PhotoPickerView.swift in Sources */,
3782E03527C4AA81000F0404 /* BeansCollectionViewOO.swift in Sources */,
371E296227C40E8800C8ACBF /* CoffeeTrackerMain.swift in Sources */,
379E1CBF27E8BF7C004101E0 /* ShareApp.swift in Sources */,
371E295127C40D2100C8ACBF /* ContentView.swift in Sources */,
37DD41CB27EA789300BEF00A /* ActivityView.swift in Sources */,
371E296527C40EC900C8ACBF /* BeanModel.swift in Sources */,
371E295B27C40D2200C8ACBF /* CoffeeTracker.xcdatamodeld in Sources */,
371E296E27C40F9A00C8ACBF /* BeanDetailView.swift in Sources */,
Expand Down
1 change: 1 addition & 0 deletions CoffeeTracker/CoffeeTracker/About/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct AboutView: View {
}
}


struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ struct BuyDevCoffeeSection: View {
)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.secondary, lineWidth: 0.5)
.shadow(color: .secondary, radius: 2, x: 0, y: 0))
.shadow(color: .secondary, radius: 20, x: 0, y: 0))
.onAppear {
Purchases.shared.getOfferings { (offerings, error) in
if let packages = offerings?.current?.availablePackages {
Expand Down
52 changes: 52 additions & 0 deletions CoffeeTracker/CoffeeTracker/About/ShareApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// ShareApp.swift
// CoffeeTracker
//
// Created by Maegan Wilson on 3/21/22.
//

import SwiftUI

struct ShareApp: View {

@Environment(\.colorScheme) private var colorScheme
@State private var showingSheet = false

var body: some View {
Button {
showingSheet = true
} label: {
HStack(spacing: 15) {
Image(systemName: SFSymbols.share)
.foregroundColor(.pink)
.font(.system(size: 36))
Text("Share coffee_ with someone")
.foregroundColor(.primary)
}.frame(maxWidth: .infinity, alignment: .leading)
.padding()
.background(
RoundedRectangle(cornerRadius: 10)
.fill(colorScheme == .light ? .quaternary : .primary)
)
.overlay(RoundedRectangle(cornerRadius: 10)
.stroke(Color.secondary, lineWidth: 0.5)
.shadow(color: .secondary, radius: 20, x: 0, y: 0))
}
.sheet(isPresented: $showingSheet) {
ActivityView(activityItems: [NSURL(string: "https://cctplus.dev")!] as [Any], applicationActivities: nil)
}

}
}

struct ShareApp_Previews: PreviewProvider {
static var previews: some View {
ZStack {
Image("Background")
.resizable()
.ignoresSafeArea()
ShareApp()
.padding()
}
}
}
24 changes: 24 additions & 0 deletions CoffeeTracker/CoffeeTracker/Components/ActivityView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// ActivityView.swift
// CoffeeTracker
//
// Created by Maegan Wilson on 3/22/22.
//

import SwiftUI

struct ActivityView: UIViewControllerRepresentable {

let activityItems: [Any]
let applicationActivities: [UIActivity]?

func makeUIViewController(context: UIViewControllerRepresentableContext<ActivityView>) -> UIActivityViewController {
return UIActivityViewController(activityItems: activityItems,
applicationActivities: applicationActivities)
}

func updateUIViewController(_ uiViewController: UIActivityViewController,
context: UIViewControllerRepresentableContext<ActivityView>) {

}
}
2 changes: 1 addition & 1 deletion CoffeeTracker/CoffeeTracker/Helpers/SFSymbolHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum SFSymbols {
static let trash = "trash"
static let pencil = "pencil.and.outline"
static let plus = "plus"
static let share = "square.and.arrow.up"
static let share = "square.and.arrow.up.fill"
static let photo = "photo"
static let coffee = "cup.and.saucer.fill"
}