Verified Commit e9ecddae authored by asahiocean's avatar asahiocean 🚀
Browse files

PinMarkerView customization

parent 383e471b
......@@ -725,7 +725,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = KXDT64LHVB;
INFOPLIST_FILE = "SZRCAI/Root Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
......@@ -746,7 +746,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = KXDT64LHVB;
INFOPLIST_FILE = "SZRCAI/Root Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
......
......@@ -3,8 +3,30 @@ import MapKit
class PinMarkerView: MKMarkerAnnotationView {
fileprivate func setup() {
canShowCallout = true
animatesWhenAdded = true
collisionMode = .circle
markerTintColor = .magenta
displayPriority = .required
clusteringIdentifier = PinMarkerView.reuseId
let n = frame.height * 0.75
let size = CGSize(width: n, height: n)
let button = UIButton(frame: .init(origin: .zero, size: size))
button.setImage(#imageLiteral(resourceName: "trash"), for: .normal)
rightCalloutAccessoryView = button
}
override var annotation: MKAnnotation? {
didSet { self.setup() }
}
override init(annotation: MKAnnotation?, reuseIdentifier: String?) {
super.init(annotation: annotation, reuseIdentifier: reuseIdentifier)
self.setup()
}
required init?(coder aDecoder: NSCoder) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment