Skip to content

Commit

Permalink
Improve Map pin view settings (#65)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
NinaWie and jannisborn authored May 14, 2023
1 parent f975b55 commit 0032e4a
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 32 deletions.
8 changes: 6 additions & 2 deletions PennyMe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -48,6 +49,7 @@
9F421AB2261B9755004197B4 /* ArtworkViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArtworkViews.swift; sourceTree = "<group>"; };
9F612053230CAC2300F1D9DE /* Artwork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Artwork.swift; sourceTree = "<group>"; };
9F70CCE9231850DC003AED89 /* all_locations.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = all_locations.json; path = data/all_locations.json; sourceTree = "<group>"; };
9F9C64A42A10D12E00C57887 /* VersionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionManager.swift; sourceTree = "<group>"; };
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 = "<group>"; };
9F9F31A62300B40900C0E854 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -128,6 +130,7 @@
9F9F31B02300B40A00C0E854 /* Info.plist */,
9F421AB2261B9755004197B4 /* ArtworkViews.swift */,
9FF43BD92621221A00BE3F6A /* SearchFooter.swift */,
9F9C64A42A10D12E00C57887 /* VersionManager.swift */,
);
path = PennyMe;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions PennyMe/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, *) {
Expand All @@ -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)"
}
}

9 changes: 9 additions & 0 deletions PennyMe/ArtworkViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading

0 comments on commit 0032e4a

Please sign in to comment.