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
5 changes: 5 additions & 0 deletions CoffeeTracker/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
identifier_name:
excluded:
- id
- URL
- oo
156 changes: 154 additions & 2 deletions CoffeeTracker/CoffeeTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@
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 */; };
37CC7B0427FE7BEE008BE09D /* BeanRowOO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CC7B0327FE7BEE008BE09D /* BeanRowOO.swift */; };
37CC7B0C27FE9224008BE09D /* BeanRowViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37CC7B0B27FE9224008BE09D /* BeanRowViewModelTests.swift */; };
37DD41CB27EA789300BEF00A /* ActivityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DD41CA27EA789300BEF00A /* ActivityView.swift */; };
37EFDD9D2800C5AD0090955E /* NewBeanOO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37EFDD9C2800C5AD0090955E /* NewBeanOO.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 */

/* Begin PBXContainerItemProxy section */
37CC7B0D27FE9224008BE09D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 371E294327C40D2100C8ACBF /* Project object */;
proxyType = 1;
remoteGlobalIDString = 371E294A27C40D2100C8ACBF;
remoteInfo = CoffeeTracker;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
371E294B27C40D2100C8ACBF /* Coffee_.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Coffee_.app; sourceTree = BUILT_PRODUCTS_DIR; };
371E294E27C40D2100C8ACBF /* CoffeeTrackerApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoffeeTrackerApp.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -68,7 +81,11 @@
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>"; };
37CC7B0327FE7BEE008BE09D /* BeanRowOO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeanRowOO.swift; sourceTree = "<group>"; };
37CC7B0927FE9224008BE09D /* CoffeeTrackerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoffeeTrackerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
37CC7B0B27FE9224008BE09D /* BeanRowViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeanRowViewModelTests.swift; sourceTree = "<group>"; };
37DD41CA27EA789300BEF00A /* ActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityView.swift; sourceTree = "<group>"; };
37EFDD9C2800C5AD0090955E /* NewBeanOO.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewBeanOO.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 All @@ -84,13 +101,21 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
37CC7B0627FE9224008BE09D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
371E294227C40D2100C8ACBF = {
isa = PBXGroup;
children = (
371E294D27C40D2100C8ACBF /* CoffeeTracker */,
37CC7B0A27FE9224008BE09D /* CoffeeTrackerTests */,
371E294C27C40D2100C8ACBF /* Products */,
37B776A427C67A6F00EFD566 /* Frameworks */,
);
Expand All @@ -100,6 +125,7 @@
isa = PBXGroup;
children = (
371E294B27C40D2100C8ACBF /* Coffee_.app */,
37CC7B0927FE9224008BE09D /* CoffeeTrackerTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -164,9 +190,9 @@
377D724D27F1DD1000DA9320 /* Views */ = {
isa = PBXGroup;
children = (
371E296627C40EF100C8ACBF /* BeanRowView.swift */,
37F18B2627E4C08500F609DF /* About */,
371E296D27C40F9A00C8ACBF /* BeanDetailView.swift */,
371E296627C40EF100C8ACBF /* BeanRowView.swift */,
371E297227C40FEF00C8ACBF /* CoffeeListView.swift */,
371E297427C4100900C8ACBF /* NewBeansView.swift */,
);
Expand Down Expand Up @@ -195,7 +221,9 @@
377D725027F1E15D00DA9320 /* ObservableObjects */ = {
isa = PBXGroup;
children = (
37CC7B0327FE7BEE008BE09D /* BeanRowOO.swift */,
3782E03427C4AA81000F0404 /* BeansCollectionViewOO.swift */,
37EFDD9C2800C5AD0090955E /* NewBeanOO.swift */,
);
path = ObservableObjects;
sourceTree = "<group>";
Expand All @@ -208,6 +236,14 @@
name = Frameworks;
sourceTree = "<group>";
};
37CC7B0A27FE9224008BE09D /* CoffeeTrackerTests */ = {
isa = PBXGroup;
children = (
37CC7B0B27FE9224008BE09D /* BeanRowViewModelTests.swift */,
);
path = CoffeeTrackerTests;
sourceTree = "<group>";
};
37DD41C927EA788100BEF00A /* Components */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -238,6 +274,7 @@
371E294727C40D2100C8ACBF /* Sources */,
371E294827C40D2100C8ACBF /* Frameworks */,
371E294927C40D2100C8ACBF /* Resources */,
37CC7B0127FE733B008BE09D /* ShellScript */,
);
buildRules = (
);
Expand All @@ -252,19 +289,41 @@
productReference = 371E294B27C40D2100C8ACBF /* Coffee_.app */;
productType = "com.apple.product-type.application";
};
37CC7B0827FE9224008BE09D /* CoffeeTrackerTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 37CC7B0F27FE9224008BE09D /* Build configuration list for PBXNativeTarget "CoffeeTrackerTests" */;
buildPhases = (
37CC7B0527FE9224008BE09D /* Sources */,
37CC7B0627FE9224008BE09D /* Frameworks */,
37CC7B0727FE9224008BE09D /* Resources */,
);
buildRules = (
);
dependencies = (
37CC7B0E27FE9224008BE09D /* PBXTargetDependency */,
);
name = CoffeeTrackerTests;
productName = CoffeeTrackerTests;
productReference = 37CC7B0927FE9224008BE09D /* CoffeeTrackerTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
371E294327C40D2100C8ACBF /* Project object */ = {
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1320;
LastSwiftUpdateCheck = 1330;
LastUpgradeCheck = 1320;
TargetAttributes = {
371E294A27C40D2100C8ACBF = {
CreatedOnToolsVersion = 13.2.1;
};
37CC7B0827FE9224008BE09D = {
CreatedOnToolsVersion = 13.3;
TestTargetID = 371E294A27C40D2100C8ACBF;
};
};
};
buildConfigurationList = 371E294627C40D2100C8ACBF /* Build configuration list for PBXProject "CoffeeTracker" */;
Expand All @@ -285,6 +344,7 @@
projectRoot = "";
targets = (
371E294A27C40D2100C8ACBF /* CoffeeTracker */,
37CC7B0827FE9224008BE09D /* CoffeeTrackerTests */,
);
};
/* End PBXProject section */
Expand All @@ -299,8 +359,35 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
37CC7B0727FE9224008BE09D /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
37CC7B0127FE733B008BE09D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if test -d \"/opt/homebrew/bin/\"; then\n PATH=\"/opt/homebrew/bin/:${PATH}\"\nfi\n\nexport PATH\n\nif which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
371E294727C40D2100C8ACBF /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand All @@ -310,6 +397,7 @@
37C9838427E4E4D4007C85E3 /* Constants.swift in Sources */,
3797E1C627D6A6F3000FE457 /* Color+Extension.swift in Sources */,
37F18B2A27E4C15200F609DF /* BuyDevCoffeeSection.swift in Sources */,
37EFDD9D2800C5AD0090955E /* NewBeanOO.swift in Sources */,
37F18B2827E4C09500F609DF /* AboutView.swift in Sources */,
37431AA227EBC57400242F39 /* RowModifier.swift in Sources */,
371E295827C40D2200C8ACBF /* Persistence.swift in Sources */,
Expand All @@ -323,6 +411,7 @@
371E295B27C40D2200C8ACBF /* CoffeeTracker.xcdatamodeld in Sources */,
3760713127EC0B6F007395C8 /* NavigationRouter.swift in Sources */,
3760713527EC10D2007395C8 /* TabBarIcon.swift in Sources */,
37CC7B0427FE7BEE008BE09D /* BeanRowOO.swift in Sources */,
371E296E27C40F9A00C8ACBF /* BeanDetailView.swift in Sources */,
3776B9E127E8B3450042C494 /* UserFeedback.swift in Sources */,
371E297327C40FEF00C8ACBF /* CoffeeListView.swift in Sources */,
Expand All @@ -334,8 +423,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
37CC7B0527FE9224008BE09D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
37CC7B0C27FE9224008BE09D /* BeanRowViewModelTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
37CC7B0E27FE9224008BE09D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 371E294A27C40D2100C8ACBF /* CoffeeTracker */;
targetProxy = 37CC7B0D27FE9224008BE09D /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
371E295C27C40D2200C8ACBF /* Debug */ = {
isa = XCBuildConfiguration;
Expand Down Expand Up @@ -517,6 +622,44 @@
};
name = Release;
};
37CC7B1027FE9224008BE09D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZDK82FGR3Z;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.cctplus.CoffeeTrackerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Coffee_.app/Coffee_";
};
name = Debug;
};
37CC7B1127FE9224008BE09D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = ZDK82FGR3Z;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.4;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dev.cctplus.CoffeeTrackerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Coffee_.app/Coffee_";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -538,6 +681,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
37CC7B0F27FE9224008BE09D /* Build configuration list for PBXNativeTarget "CoffeeTrackerTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
37CC7B1027FE9224008BE09D /* Debug */,
37CC7B1127FE9224008BE09D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
Expand Down
2 changes: 1 addition & 1 deletion CoffeeTracker/CoffeeTracker/CoffeeTrackerApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Maegan Wilson on 2/21/22.
//

/**
/*
Supporters:
MikaelaCaron
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct ImagePicker: UIViewControllerRepresentable {

@Binding var selectedImage: UIImage
@Binding var isImageSelected: Bool

var itemProviders: [NSItemProvider] = []

@Environment(\.presentationMode) private var presentationMode
Expand Down
8 changes: 6 additions & 2 deletions CoffeeTracker/CoffeeTracker/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ struct ContentView: View {
try viewContext.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
// fatalError() causes the application to generate a crash log and terminate.
// You should not use this function in a shipping application,
// although it may be useful during development.
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
Expand All @@ -66,7 +68,9 @@ struct ContentView: View {
try viewContext.save()
} catch {
// Replace this implementation with code to handle the error appropriately.
// fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
// fatalError() causes the application to generate a crash log and terminate.
// You should not use this function in a shipping application,
// although it may be useful during development.
let nsError = error as NSError
fatalError("Unresolved error \(nsError), \(nsError.userInfo)")
}
Expand Down
2 changes: 1 addition & 1 deletion CoffeeTracker/CoffeeTracker/Models/BeanModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct BeanModel: Identifiable, Hashable {

func updateBean(context: NSManagedObjectContext) {
print(beanType)

let fetchRequest: NSFetchRequest<Bean>
fetchRequest = Bean.fetchRequest()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ struct CoffeeTrackerMain: View {
@StateObject var navRouter: NavigationRouter

@State private var showButtons = false
@StateObject var beanOO = NewBeanOO(bean: nil)

var plusRotation: Double {
return navRouter.currentPage == .newBeans ? 45 : 0
}

var body: some View {
GeometryReader { geometry in
Expand All @@ -28,6 +33,7 @@ struct CoffeeTrackerMain: View {
AboutView()
case .newBeans:
NewBeansView(navRouter: navRouter)
.environmentObject(beanOO)
}
}
HStack(alignment: .bottom) {
Expand All @@ -52,7 +58,7 @@ struct CoffeeTrackerMain: View {
.frame(width: geometry.size.width/7, height: geometry.size.width/7))
.padding(12)
.shadow(radius: 8, x: 4, y: 4)
.rotationEffect(Angle.degrees(navRouter.currentPage == .newBeans ? 45 : 0))
.rotationEffect(Angle.degrees(plusRotation))
}.padding(20)
.tint(.white)
}
Expand Down
Loading