From ede4f0cc0a08ed8c3c7f9a7c605c75f9a357d4f0 Mon Sep 17 00:00:00 2001 From: Deniz Duezgoeren Date: Sat, 19 Oct 2019 09:29:59 +0200 Subject: [PATCH] Added empty food menu notice, code for checking the app version, possible fix for jumpy CollectionView behaviour, TODO: check on real device --- AvH Plan.xcodeproj/project.pbxproj | 4 ++-- AvH Plan/CustomizationViewController.swift | 7 +++++++ AvH Plan/DataFetcher.swift | 10 ++++++++-- AvH Plan/MenuViewController.swift | 6 +++++- AvH Plan/PlanViewController.swift | 6 +++++- AvH Plan/de.lproj/Localizable.strings | 1 + AvH Plan/en.lproj/Localizable.strings | 1 + 7 files changed, 29 insertions(+), 6 deletions(-) diff --git a/AvH Plan.xcodeproj/project.pbxproj b/AvH Plan.xcodeproj/project.pbxproj index 5ceda92..0aea41c 100644 --- a/AvH Plan.xcodeproj/project.pbxproj +++ b/AvH Plan.xcodeproj/project.pbxproj @@ -722,7 +722,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.denizd.substitutionplan; + PRODUCT_BUNDLE_IDENTIFIER = "denizd.AvH-Plan"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -742,7 +742,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.denizd.substitutionplan; + PRODUCT_BUNDLE_IDENTIFIER = "denizd.AvH-Plan"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/AvH Plan/CustomizationViewController.swift b/AvH Plan/CustomizationViewController.swift index 32b7138..690ca13 100644 --- a/AvH Plan/CustomizationViewController.swift +++ b/AvH Plan/CustomizationViewController.swift @@ -119,6 +119,13 @@ class CustomizationViewController: UITableViewController, UITextFieldDelegate, U self.prefs.set(newValue, forKey: "use_test_urls") toastMessage = "Test URLs set to \(newValue)" break + case "_version": + if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String { + toastMessage = "App version: \(version)" + } else { + toastMessage = "Version couldn't be resolved" + } + break default: toastMessage = NSLocalizedString("invalid_code", comment: "") break diff --git a/AvH Plan/DataFetcher.swift b/AvH Plan/DataFetcher.swift index 194fd6b..4a16d8e 100644 --- a/AvH Plan/DataFetcher.swift +++ b/AvH Plan/DataFetcher.swift @@ -169,6 +169,7 @@ class DataFetcher { var isPlanEmpty = true var isPersonalEmpty = true + var isFoodMenuEmpty = true var personalPlanCount = 0 var mWebsitePriority = 0 @@ -267,6 +268,7 @@ class DataFetcher { indices.append(foodItems.size()) for l in 0.. String { diff --git a/AvH Plan/de.lproj/Localizable.strings b/AvH Plan/de.lproj/Localizable.strings index 5054b3f..dc89d43 100644 --- a/AvH Plan/de.lproj/Localizable.strings +++ b/AvH Plan/de.lproj/Localizable.strings @@ -67,6 +67,7 @@ "plan_empty" = "Der Vertretungsplan ist leer"; "personal_plan_empty" = "Dein Plan ist leer :("; +"food_menu_empty" = "Der Speiseplan ist leer"; // titles "avh_plan" = "AvH-Plan"; diff --git a/AvH Plan/en.lproj/Localizable.strings b/AvH Plan/en.lproj/Localizable.strings index 0fb48c6..35b0d18 100644 --- a/AvH Plan/en.lproj/Localizable.strings +++ b/AvH Plan/en.lproj/Localizable.strings @@ -68,6 +68,7 @@ "plan_empty" = "The substitution plan is empty"; "personal_plan_empty" = "Your plan is empty :("; +"food_menu_empty" = "The food menu is empty"; // titles "avh_plan" = "AvH Plan";