From 0032e4a98ee0eceb091f6d5ac3e0ba33329aed4e Mon Sep 17 00:00:00 2001 From: Nina Wiedemann Date: Sun, 14 May 2023 09:07:17 +0000 Subject: [PATCH] Improve Map pin view settings (#65) * wip: hard-coding of map zoom fixing * feat: Hard-coded map clustering to False * add switches for settings screen and connect them to map view * working version of pin view setting * cleanups of changes * wip: finishing mapoptions * feat: Add pop-up for version change info * fix: Flexible version reading in About Table --------- Co-authored-by: jannisborn --- PennyMe.xcodeproj/project.pbxproj | 8 +- PennyMe/AboutViewController.swift | 4 +- PennyMe/ArtworkViews.swift | 9 ++ PennyMe/Base.lproj/Main.storyboard | 187 ++++++++++++++++++++++++--- PennyMe/PinViewController.swift | 10 +- PennyMe/SettingsViewController.swift | 61 +++++++++ PennyMe/VersionManager.swift | 37 ++++++ PennyMe/ViewController.swift | 59 ++++++++- 8 files changed, 343 insertions(+), 32 deletions(-) create mode 100644 PennyMe/VersionManager.swift diff --git a/PennyMe.xcodeproj/project.pbxproj b/PennyMe.xcodeproj/project.pbxproj index 73834cd5b..336dbb222 100644 --- a/PennyMe.xcodeproj/project.pbxproj +++ b/PennyMe.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 9F421AB3261B9755004197B4 /* ArtworkViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F421AB2261B9755004197B4 /* ArtworkViews.swift */; }; 9F612054230CAC2300F1D9DE /* Artwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F612053230CAC2300F1D9DE /* Artwork.swift */; }; 9F70CCEA231850DC003AED89 /* all_locations.json in Resources */ = {isa = PBXBuildFile; fileRef = 9F70CCE9231850DC003AED89 /* all_locations.json */; }; + 9F9C64A52A10D12E00C57887 /* VersionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9C64A42A10D12E00C57887 /* VersionManager.swift */; }; 9F9F31A52300B40900C0E854 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9F31A42300B40900C0E854 /* AppDelegate.swift */; }; 9F9F31A72300B40900C0E854 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9F31A62300B40900C0E854 /* ViewController.swift */; }; 9F9F31AA2300B40900C0E854 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F9F31A82300B40900C0E854 /* Main.storyboard */; }; @@ -48,6 +49,7 @@ 9F421AB2261B9755004197B4 /* ArtworkViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtworkViews.swift; sourceTree = ""; }; 9F612053230CAC2300F1D9DE /* Artwork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Artwork.swift; sourceTree = ""; }; 9F70CCE9231850DC003AED89 /* all_locations.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = all_locations.json; path = data/all_locations.json; sourceTree = ""; }; + 9F9C64A42A10D12E00C57887 /* VersionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionManager.swift; sourceTree = ""; }; 9F9F31A12300B40900C0E854 /* PennyMe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PennyMe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9F9F31A42300B40900C0E854 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 9F9F31A62300B40900C0E854 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -128,6 +130,7 @@ 9F9F31B02300B40A00C0E854 /* Info.plist */, 9F421AB2261B9755004197B4 /* ArtworkViews.swift */, 9FF43BD92621221A00BE3F6A /* SearchFooter.swift */, + 9F9C64A42A10D12E00C57887 /* VersionManager.swift */, ); path = PennyMe; sourceTree = ""; @@ -296,6 +299,7 @@ files = ( 9F9F31A72300B40900C0E854 /* ViewController.swift in Sources */, 8319D8D027414AC100E97D93 /* ZoomViewController.swift in Sources */, + 9F9C64A52A10D12E00C57887 /* VersionManager.swift in Sources */, 9F421AB3261B9755004197B4 /* ArtworkViews.swift in Sources */, 83D226CD2620F4910050ED9E /* PinViewController.swift in Sources */, 9F612054230CAC2300F1D9DE /* Artwork.swift in Sources */, @@ -485,7 +489,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = "PennyMe--com.de.pennyme"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; @@ -505,7 +509,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.4; + MARKETING_VERSION = 1.5; PRODUCT_BUNDLE_IDENTIFIER = "PennyMe--com.de.pennyme"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; diff --git a/PennyMe/AboutViewController.swift b/PennyMe/AboutViewController.swift index 7475f6eb5..4e843edec 100644 --- a/PennyMe/AboutViewController.swift +++ b/PennyMe/AboutViewController.swift @@ -12,7 +12,7 @@ class AboutViewController: UIViewController { @IBOutlet weak var label: UILabel! - + private let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String override func viewDidLoad() { super.viewDidLoad() if #available(iOS 13.0, *) { @@ -22,7 +22,7 @@ class AboutViewController: UIViewController { self.label.contentMode = .scaleToFill self.label.numberOfLines = 30 - self.label.text = "PennyMe makes collecting pennys easier than ever before - anywhere you travel. \n\nYou can view locations of nearby penny machines and explore your favorite destinations. Change the status of the pins and turn PennyMe into your digital penny collection. PennyMe also helps you to navigate to the next machine and provides pictures and more information about each machine. To ease your life, PennyMe can also send you push notifications if you are nearby an unvisted penny machine. 
Please help growing our database by sending pictures or information about machine and feel free to send us any feedback. \n\nThis is PennyMe V1.3.\n©Jannis Born & Nina Wiedemann (2023)" + self.label.text = "PennyMe makes collecting pennys easier than ever before - anywhere you travel. \n\nYou can view locations of nearby penny machines and explore your favorite destinations. Change the status of the pins and turn PennyMe into your digital penny collection. PennyMe also helps you to navigate to the next machine and provides pictures and more information about each machine. To ease your life, PennyMe can also send you push notifications if you are nearby an unvisted penny machine. 
Please help growing our database by sending pictures or information about machine and feel free to send us any feedback. \n\nThis is PennyMe v\(currentVersion ?? "").\n©Jannis Born & Nina Wiedemann (2023)" } } diff --git a/PennyMe/ArtworkViews.swift b/PennyMe/ArtworkViews.swift index bde201be6..ca701904b 100644 --- a/PennyMe/ArtworkViews.swift +++ b/PennyMe/ArtworkViews.swift @@ -10,12 +10,21 @@ import Foundation import MapKit class ArtworkMarkerView: MKMarkerAnnotationView { + + var clusterPins: Bool = true override var annotation: MKAnnotation? { + willSet { // 1 guard let artwork = newValue as? Artwork else { return } + clusterPins = UserDefaults.standard.bool(forKey: "clusterPinSwitch") + + if !clusterPins { + displayPriority = MKFeatureDisplayPriority.required + } + // Set marker color markerTintColor = artwork.markerTintColor diff --git a/PennyMe/Base.lproj/Main.storyboard b/PennyMe/Base.lproj/Main.storyboard index b9fd87554..7066bb278 100644 --- a/PennyMe/Base.lproj/Main.storyboard +++ b/PennyMe/Base.lproj/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -18,7 +18,7 @@ - +