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
4 changes: 4 additions & 0 deletions CoffeeTracker/CoffeeTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
3760713127EC0B6F007395C8 /* NavigationRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3760713027EC0B6F007395C8 /* NavigationRouter.swift */; };
3760713527EC10D2007395C8 /* TabBarIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3760713427EC10D2007395C8 /* TabBarIcon.swift */; };
376A5E5327D844D60038BDA0 /* PhotoPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376A5E5227D844D60038BDA0 /* PhotoPickerView.swift */; };
37766A3428067736006489CE /* WhatsNewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37766A3328067736006489CE /* WhatsNewView.swift */; };
3776B9DE27E8B32D0042C494 /* OctoKit in Frameworks */ = {isa = PBXBuildFile; productRef = 3776B9DD27E8B32D0042C494 /* OctoKit */; };
3776B9E127E8B3450042C494 /* UserFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3776B9E027E8B3450042C494 /* UserFeedback.swift */; };
3782E03527C4AA81000F0404 /* BeansCollectionViewOO.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3782E03427C4AA81000F0404 /* BeansCollectionViewOO.swift */; };
Expand Down Expand Up @@ -72,6 +73,7 @@
3760713027EC0B6F007395C8 /* NavigationRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationRouter.swift; sourceTree = "<group>"; };
3760713427EC10D2007395C8 /* TabBarIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarIcon.swift; sourceTree = "<group>"; };
376A5E5227D844D60038BDA0 /* PhotoPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoPickerView.swift; sourceTree = "<group>"; };
37766A3328067736006489CE /* WhatsNewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewView.swift; sourceTree = "<group>"; };
3776B9E027E8B3450042C494 /* UserFeedback.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserFeedback.swift; sourceTree = "<group>"; };
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>"; };
Expand Down Expand Up @@ -260,6 +262,7 @@
37F18B2927E4C15200F609DF /* BuyDevCoffeeSection.swift */,
3776B9E027E8B3450042C494 /* UserFeedback.swift */,
379E1CBE27E8BF7C004101E0 /* ShareApp.swift */,
37766A3328067736006489CE /* WhatsNewView.swift */,
);
path = About;
sourceTree = "<group>";
Expand Down Expand Up @@ -410,6 +413,7 @@
371E296527C40EC900C8ACBF /* BeanModel.swift in Sources */,
371E295B27C40D2200C8ACBF /* CoffeeTracker.xcdatamodeld in Sources */,
3760713127EC0B6F007395C8 /* NavigationRouter.swift in Sources */,
37766A3428067736006489CE /* WhatsNewView.swift in Sources */,
3760713527EC10D2007395C8 /* TabBarIcon.swift in Sources */,
37CC7B0427FE7BEE008BE09D /* BeanRowOO.swift in Sources */,
371E296E27C40F9A00C8ACBF /* BeanDetailView.swift in Sources */,
Expand Down
2 changes: 2 additions & 0 deletions CoffeeTracker/CoffeeTracker/Helpers/SFSymbolHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ enum SFSymbols {
static let list = "list.dash.header.rectangle"
static let info = "info.circle"
static let rectRoundedBottom = "rectangle.roundedbottom"
static let star = "star.fill"
static let ladybug = "ladybug.fill"
}
21 changes: 21 additions & 0 deletions CoffeeTracker/CoffeeTracker/Navigation/CoffeeTrackerMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import SwiftUI

struct CoffeeTrackerMain: View {
@AppStorage("showNewView") var showNewView: Bool = true
@AppStorage("lastSeenVersion") var version: String = "1.0"

@Environment(\.managedObjectContext) private var viewContext

@StateObject var navRouter: NavigationRouter
Expand All @@ -29,12 +32,30 @@ struct CoffeeTrackerMain: View {
switch navRouter.currentPage {
case .coffees:
CoffeeListView()
.popover(isPresented: $showNewView) {
WhatsNewView()
.onDisappear {
showNewView = false
}
}
case .info:
AboutView()
case .newBeans:
NewBeansView(navRouter: navRouter)
.environmentObject(beanOO)
}
}.onAppear {
let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
guard let currentVersion = currentVersion else {
return
}
if currentVersion != version {
showNewView = true
version = currentVersion
} else {
showNewView = false
version = currentVersion
}
}
HStack(alignment: .bottom) {
TabBarIcon(navRouter: navRouter,
Expand Down
16 changes: 16 additions & 0 deletions CoffeeTracker/CoffeeTracker/Views/About/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct AboutView: View {
@Environment(\.colorScheme) private var colorScheme
@State private var showingSheet = false
@State private var showFeedback = false
@State private var showingWhatsNew = false

var body: some View {
ZStack {
Expand Down Expand Up @@ -41,6 +42,21 @@ struct AboutView: View {
}.sheet(isPresented: $showFeedback) {
UserFeedbackView()
}
Button {
showingWhatsNew = true
} label: {
HStack(spacing: 15) {
Image(systemName: SFSymbols.star)
.foregroundColor(.pink)
.font(.system(size: 36))
Text("Release Notes")
.foregroundColor(.primary)
}.frame(maxWidth: .infinity, alignment: .leading)
.row().padding()

}.sheet(isPresented: $showingWhatsNew) {
WhatsNewView()
}

HStack {
Spacer()
Expand Down
72 changes: 72 additions & 0 deletions CoffeeTracker/CoffeeTracker/Views/About/WhatsNewView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//
// WhatsNewView.swift
// CoffeeTracker
//
// Created by Maegan Wilson on 4/12/22.
//

import SwiftUI

struct WhatsNewView: View {
var body: some View {
ScrollView {
VStack(alignment: .leading) {
Text("What's new in v1.1")
.font(.largeTitle)
.bold()
// Features
VStack(alignment: .leading, spacing: 10) {
HStack {
Image(systemName: SFSymbols.star)
.foregroundColor(.green)
Text("Features")
.font(.title)
Spacer()
}
HStack(alignment: .top) {
Text("\u{2022}")
Text("Share your coffee information as a picture")
}
HStack(alignment: .top) {
Text("\u{2022}")
Text("Coffee categories")
}
HStack(alignment: .top) {
Text("\u{2022}")
Text("Coffee Notes")
}.padding(.bottom)
}.padding()
.row()
.padding(.bottom)
// Bug Fixes
VStack(alignment: .leading, spacing: 10) {
HStack {
Image(systemName: SFSymbols.ladybug)
.foregroundColor(.red)
Text("Bug Fixes")
.font(.title)
Spacer()
}
HStack(alignment: .top) {
Text("\u{2022}")
Text("Dev coffee cup counter now counts correctly")
}.padding(.bottom)
}.padding()
.row()
.padding(.bottom)
BuyDevCoffeeSection()
}.padding()
}
}
}

struct WhatsNewView_Previews: PreviewProvider {
static var previews: some View {
ZStack {
Image("Background")
.resizable()
.ignoresSafeArea()
WhatsNewView()
}.preferredColorScheme(.dark)
}
}