diff --git a/RIT Dining.xcodeproj/project.pbxproj b/RIT Dining.xcodeproj/project.pbxproj index 99ce77a..58d258f 100644 --- a/RIT Dining.xcodeproj/project.pbxproj +++ b/RIT Dining.xcodeproj/project.pbxproj @@ -265,7 +265,7 @@ CODE_SIGN_ENTITLEMENTS = "RIT Dining/RIT Dining.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -300,7 +300,7 @@ CODE_SIGN_ENTITLEMENTS = "RIT Dining/RIT Dining.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 19; + CURRENT_PROJECT_VERSION = 20; DEVELOPMENT_TEAM = 5GF7GKNTK4; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; diff --git a/RIT Dining/Assets.xcassets/AppIcon.appiconset/Contents.json b/RIT Dining/Assets.xcassets/AppIcon.appiconset/Contents.json index ee0fc91..25f8e63 100644 --- a/RIT Dining/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/RIT Dining/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,7 +1,30 @@ { "images" : [ { - "filename" : "RIT Dining Temp Logo.png", + "filename" : "TigerDine Temp Logo-iOS-Default-1024x1024@1x.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], "idiom" : "universal", "platform" : "ios", "size" : "1024x1024" diff --git a/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png b/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png new file mode 100644 index 0000000..fa5cd4b Binary files /dev/null and b/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png differ diff --git a/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png b/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png new file mode 100644 index 0000000..fa88f91 Binary files /dev/null and b/RIT Dining/Assets.xcassets/AppIcon.appiconset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png differ diff --git a/RIT Dining/Assets.xcassets/AppIconOld.appiconset/Contents.json b/RIT Dining/Assets.xcassets/AppIconOld.appiconset/Contents.json new file mode 100644 index 0000000..ee0fc91 --- /dev/null +++ b/RIT Dining/Assets.xcassets/AppIconOld.appiconset/Contents.json @@ -0,0 +1,14 @@ +{ + "images" : [ + { + "filename" : "RIT Dining Temp Logo.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/RIT Dining/Assets.xcassets/AppIcon.appiconset/RIT Dining Temp Logo.png b/RIT Dining/Assets.xcassets/AppIconOld.appiconset/RIT Dining Temp Logo.png similarity index 100% rename from RIT Dining/Assets.xcassets/AppIcon.appiconset/RIT Dining Temp Logo.png rename to RIT Dining/Assets.xcassets/AppIconOld.appiconset/RIT Dining Temp Logo.png diff --git a/RIT Dining/Assets.xcassets/Icon.imageset/Contents.json b/RIT Dining/Assets.xcassets/Icon.imageset/Contents.json index 07ef905..98373df 100644 --- a/RIT Dining/Assets.xcassets/Icon.imageset/Contents.json +++ b/RIT Dining/Assets.xcassets/Icon.imageset/Contents.json @@ -1,7 +1,17 @@ { "images" : [ { - "filename" : "RIT Dining Temp Logo.png", + "filename" : "TigerDine Temp Logo-iOS-Default-1024x1024@1x.png", + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "filename" : "TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png", "idiom" : "universal" } ], diff --git a/RIT Dining/Assets.xcassets/Icon.imageset/RIT Dining Temp Logo.png b/RIT Dining/Assets.xcassets/Icon.imageset/RIT Dining Temp Logo.png deleted file mode 100644 index b5eb116..0000000 Binary files a/RIT Dining/Assets.xcassets/Icon.imageset/RIT Dining Temp Logo.png and /dev/null differ diff --git a/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png b/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png new file mode 100644 index 0000000..fa5cd4b Binary files /dev/null and b/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Dark-1024x1024@1x.png differ diff --git a/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png b/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png new file mode 100644 index 0000000..fa88f91 Binary files /dev/null and b/RIT Dining/Assets.xcassets/Icon.imageset/TigerDine Temp Logo-iOS-Default-1024x1024@1x.png differ diff --git a/RIT Dining/Components/FDMealPlannerParsers.swift b/RIT Dining/Components/FDMealPlannerParsers.swift index 36ca91d..d98c52d 100644 --- a/RIT Dining/Components/FDMealPlannerParsers.swift +++ b/RIT Dining/Components/FDMealPlannerParsers.swift @@ -24,9 +24,9 @@ func parseFDMealPlannerMenu(menu: FDMealsParser) -> [FDMenuItem] { // englishAlternateName holds the proper name of the item, but it's blank for some items for some reason. If that's the // case, then we should fall back on componentName, which is less user-friendly but works as a backup. let realName = if recipe.englishAlternateName != "" { - recipe.englishAlternateName + recipe.englishAlternateName.trimmingCharacters(in: .whitespaces) } else { - recipe.componentName + recipe.componentName.trimmingCharacters(in: .whitespaces) } let allergens = recipe.allergenName != "" ? recipe.allergenName.components(separatedBy: ",") : [] // Get the list of dietary markers (Vegan, Vegetarian, Pork, Beef), and drop "Vegetarian" if "Vegan" is also included since diff --git a/RIT Dining/Data/MenuDietaryRestrictionsModel.swift b/RIT Dining/Data/MenuDietaryRestrictionsModel.swift index 1ba937e..57f21c9 100644 --- a/RIT Dining/Data/MenuDietaryRestrictionsModel.swift +++ b/RIT Dining/Data/MenuDietaryRestrictionsModel.swift @@ -7,10 +7,10 @@ import SwiftUI -@Observable -class MenuDietaryRestrictionsModel { - var filteredDietaryMarkers: Set = [] +class MenuDietaryRestrictionsModel: ObservableObject { var dietaryRestrictions = DietaryRestrictions() - var isVegetarian: Bool = false - var isVegan: Bool = false + @AppStorage("isVegetarian") var isVegetarian: Bool = false + @AppStorage("isVegan") var isVegan: Bool = false + @AppStorage("noBeef") var noBeef: Bool = false + @AppStorage("noPork") var noPork: Bool = false } diff --git a/RIT Dining/Views/AboutView.swift b/RIT Dining/Views/AboutView.swift index 6fd8d57..7a3a16d 100644 --- a/RIT Dining/Views/AboutView.swift +++ b/RIT Dining/Views/AboutView.swift @@ -20,35 +20,42 @@ struct AboutView: View { .clipShape(RoundedRectangle(cornerRadius: 20)) Text("TigerDine") .font(.title) + .fontWeight(.bold) Text("An unofficial RIT Dining app") .font(.subheadline) Text("Version \(appVersionString) (\(buildNumber))") .foregroundStyle(.secondary) .padding(.bottom, 2) VStack(alignment: .leading, spacing: 10) { - Text("Dining locations, their descriptions, and their opening hours are sourced from the RIT student-run TigerCenter API. Building occupancy information is sourced from the official RIT maps API.") + Text("Dining locations, their descriptions, and their opening hours are sourced from the RIT student-run TigerCenter API. Building occupancy information is sourced from the official RIT maps API. Menu and nutritional information is sourced from the data provided to FD MealPlanner by RIT Dining through the FD MealPlanner API.") Text("This app is not affiliated, associated, authorized, endorsed by, or in any way officially connected with the Rochester Institute of Technology. This app is student created and maintained.") - HStack { - Button(action: { - openURL(URL(string: "https://github.com/NinjaCheetah/TigerDine")!) - }) { - Text("Source Code") + VStack(alignment: .center, spacing: 8) { + HStack(spacing: 8) { + Button(action: { + openURL(URL(string: "https://github.com/NinjaCheetah/TigerDine")!) + }) { + Label("Source Code", systemImage: "network") + } + Button(action: { + openURL(URL(string: "https://tigercenter.rit.edu/")!) + }) { + Label("TigerCenter", systemImage: "fork.knife.circle") + } } - Text("•") - .foregroundStyle(.secondary) - Button(action: { - openURL(URL(string: "https://tigercenter.rit.edu/")!) - }) { - Text("TigerCenter") - } - Text("•") - .foregroundStyle(.secondary) - Button(action: { - openURL(URL(string: "https://maps.rit.edu/")!) - }) { - Text("Official RIT Map") + HStack(spacing: 8) { + Button(action: { + openURL(URL(string: "https://maps.rit.edu/")!) + }) { + Label("Official RIT Map", systemImage: "map") + } + Button(action: { + openURL(URL(string: "https://fdmealplanner.com/")!) + }) { + Label("FD MealPlanner", systemImage: "menucard") + } } } + .frame(maxWidth: .infinity) } Spacer() } diff --git a/RIT Dining/Views/Menus/MenuDietaryRestrictionsSheet.swift b/RIT Dining/Views/Menus/MenuDietaryRestrictionsSheet.swift index 19bdefd..b947054 100644 --- a/RIT Dining/Views/Menus/MenuDietaryRestrictionsSheet.swift +++ b/RIT Dining/Views/Menus/MenuDietaryRestrictionsSheet.swift @@ -15,32 +15,10 @@ struct MenuDietaryRestrictionsSheet: View { NavigationView { Form { Section(header: Text("Diet")) { - Toggle(isOn: Binding( - get: { - dietaryRestrictionsModel.filteredDietaryMarkers.contains("Beef") - }, - set: { isOn in - if isOn { - dietaryRestrictionsModel.filteredDietaryMarkers.insert("Beef") - } else { - dietaryRestrictionsModel.filteredDietaryMarkers.remove("Beef") - } - } ) - ) { + Toggle(isOn: $dietaryRestrictionsModel.noBeef) { Text("No Beef") } - Toggle(isOn: Binding( - get: { - dietaryRestrictionsModel.filteredDietaryMarkers.contains("Pork") - }, - set: { isOn in - if isOn { - dietaryRestrictionsModel.filteredDietaryMarkers.insert("Pork") - } else { - dietaryRestrictionsModel.filteredDietaryMarkers.remove("Pork") - } - } ) - ) { + Toggle(isOn: $dietaryRestrictionsModel.noPork) { Text("No Pork") } Toggle(isOn: $dietaryRestrictionsModel.isVegetarian) { diff --git a/RIT Dining/Views/Menus/MenuView.swift b/RIT Dining/Views/Menus/MenuView.swift index 8285d3d..02c35f8 100644 --- a/RIT Dining/Views/Menus/MenuView.swift +++ b/RIT Dining/Views/Menus/MenuView.swift @@ -65,17 +65,6 @@ struct MenuView: View { private var filteredMenuItems: [FDMenuItem] { var newItems = menuItems - // Filter out dietary restrictions, starting with pork/beef since those are tagged. - if !dietaryRestrictionsModel.filteredDietaryMarkers.isEmpty { - newItems = newItems.filter { item in - for marker in dietaryRestrictionsModel.filteredDietaryMarkers { - if item.dietaryMarkers.contains(marker) { - return false - } - } - return true - } - } // Filter out allergens. newItems = newItems.filter { item in if !item.allergens.isEmpty { @@ -100,6 +89,17 @@ struct MenuView: View { return false } } + // Filter out pork/beef. + if dietaryRestrictionsModel.noBeef { + newItems = newItems.filter { item in + item.dietaryMarkers.contains("Beef") == false + } + } + if dietaryRestrictionsModel.noPork { + newItems = newItems.filter { item in + item.dietaryMarkers.contains("Pork") == false + } + } // Filter down to search contents. newItems = newItems.filter { item in let searchedLocations = searchText.isEmpty || item.name.localizedCaseInsensitiveContains(searchText)