Manos Chorianopoulos

MapViewController part1

Showing 35 changed files with 955 additions and 2 deletions
......@@ -7,7 +7,7 @@
<key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -73,6 +73,9 @@
1EDD0AC62E0D68B6005E162B /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 1EDD0AC52E0D68B6005E162B /* SQLite */; };
622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */; };
622DA0AF2F51CAEE00308AB8 /* CouponsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */; };
626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */; };
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DC2F699081008BCA08 /* MapViewController.swift */; };
626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 626AF6DD2F699081008BCA08 /* MapViewController.xib */; };
62A0A6D32F67FEDC00508534 /* MyCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */; };
62A0A6D42F67FEDC00508534 /* MyCouponsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */; };
62A0A6D82F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */; };
......@@ -154,6 +157,9 @@
1EDD0ABC2E0D308A005E162B /* XIBLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XIBLoader.swift; sourceTree = "<group>"; };
622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsetViewController.swift; sourceTree = "<group>"; };
622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponsetViewController.xib; sourceTree = "<group>"; };
626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
626AF6DC2F699081008BCA08 /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
626AF6DD2F699081008BCA08 /* MapViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsViewController.swift; sourceTree = "<group>"; };
62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyCouponsViewController.xib; sourceTree = "<group>"; };
62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsHeaderTableViewCell.swift; sourceTree = "<group>"; };
......@@ -331,6 +337,7 @@
1EA8E5B42DDF315600CD3418 /* screens */ = {
isa = PBXGroup;
children = (
626AF6D92F698F96008BCA08 /* MapViewController */,
622DA0AB2F51CA9100308AB8 /* CouponsetViewController */,
1EBE45642E02DDF90055A0D4 /* CampaignViewController */,
1E917CD32DDF6472002221D8 /* MyRewardsViewController */,
......@@ -449,6 +456,16 @@
path = CouponsetViewController;
sourceTree = "<group>";
};
626AF6D92F698F96008BCA08 /* MapViewController */ = {
isa = PBXGroup;
children = (
626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */,
626AF6DC2F699081008BCA08 /* MapViewController.swift */,
626AF6DD2F699081008BCA08 /* MapViewController.xib */,
);
path = MapViewController;
sourceTree = "<group>";
};
62A0A6D02F67FE8100508534 /* MyCouponsViewController */ = {
isa = PBXGroup;
children = (
......@@ -643,6 +660,7 @@
1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */,
622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */,
1E64E1832DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib in Resources */,
626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */,
1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */,
1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */,
1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */,
......@@ -735,8 +753,10 @@
1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */,
1E917CDC2DDF68C7002221D8 /* CouponViewController.swift in Sources */,
1E4C4CFB2DE6014500279AAD /* CopyableLabel.swift in Sources */,
626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */,
1EDBAF112DE8443B00911E79 /* ProfileHeaderTableViewCell.swift in Sources */,
1EDBAF052DE843CA00911E79 /* ProfileCouponTableViewCell.swift in Sources */,
626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */,
1EB4F4262DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -7,7 +7,7 @@
<key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
{
"images" : [
{
"filename" : "filter.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "filter 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "filter 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_close_4.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_close_4 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_close_4 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "map_location.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_location 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_location 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "map_navigate.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_navigate 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_navigate 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "map_pin.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_pin 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_pin 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "map_pin_2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_pin_2 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_pin_2 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "map_telephone.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "map_telephone 1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "map_telephone 2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// MapViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 17/3/26.
//
import UIKit
import MapKit
@objc public class MapViewController: UIViewController, MKMapViewDelegate {
// ui
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet private var mapView: MKMapView!
@IBOutlet weak var closeButton: UIButton!
@IBOutlet private var titleView: UILabel!
@IBOutlet private var nameImageView: UIImageView!
@IBOutlet private var nameView: UILabel!
@IBOutlet private var hoursView: UILabel!
@IBOutlet private var phoneView: UILabel!
@IBOutlet private var addressView: UILabel!
@IBOutlet private var directionsButton: UIButton!
@IBOutlet private var infoTopConstraint: NSLayoutConstraint!
@IBOutlet weak var topBorderLine: UIImageView!
@IBOutlet weak var phoneImageView: UIImageView!
@IBOutlet weak var addressImageView: UIImageView!
// public
public var coupon: CouponItemModel?
public var isMarket: Bool? = false
var merchantsArray:Array<MerchantModel> = []
var selectedMerchant: MerchantModel?
var annotationGroup = [MKPointAnnotation]()
var parentMerchant: MerchantModel?
var parentMerchantsArray:Array<MerchantModel> = []
//
var loading: Bool = false
let initialLocation = CLLocation(latitude: 37.9641262, longitude: 23.7468592) // greece
//
public override func viewDidLoad() {
super.viewDidLoad()
self.hidesBottomBarWhenPushed = true
self.infoTopConstraint.constant = 0
setBackButton()
setNavigationTitle("Καταστήματα")
backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
phoneImageView.image = UIImage(named: "ic_phone", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
addressImageView.image = UIImage(named: "ic_address", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
mapView.delegate = self
mapView.centerToLocation(initialLocation, regionRadius: 1000000)
// mapView.clipsToBounds = true
// mapView.layer.cornerRadius = 30
// mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
// var aspectR: CGFloat = 0.0
//
// aspectR = image.size.width/image.size.height
// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
// topBorderLine.image = image
// topBorderLine.contentMode = .scaleAspectFill
//
// NSLayoutConstraint.activate([
// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
// ])
closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
closeButton.setImage(UIImage(named: "ic_close_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
titleView.textColor = UIColor(rgb: 0x757575)
nameView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
nameView.textColor = UIColor(rgb: 0x415564)
hoursView.font = UIFont(name: "PFSquareSansPro-Regular", size: 18)
hoursView.textColor = UIColor(rgb: 0xAEAEAE)
hoursView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
hoursView.textColor = UIColor(rgb: 0x415564)
addressView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
addressView.textColor = UIColor(rgb: 0x415564)
//directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
directionsButton.setTitle("Οδηγίες", for: .normal)
directionsButton.setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
// directionsButton.sizeToFit()
directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
directionsButton.setTitleColor(.white, for: .normal)
directionsButton.tintColor = .white
directionsButton.backgroundColor = UIColor(rgb: 0x0E8103)
directionsButton.layer.cornerRadius = 16.0
// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
directionsButton.frame = CGRect(x: 0.0, y: 0.0, width: directionsButton.intrinsicContentSize.width+10, height: 50)
// directionsButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
directionsButton.setInsets(forContentPadding: UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15), imageTitlePadding: 10)
load()
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
// logTrackersEvent("screen", "ShopsScreen")
self.navigationController?.hideHairline()
}
// mvp
@objc func load() {
if (loading) {
return;
}
showLoading()
if (coupon != nil) {
if let merchantUuid: String = coupon?.merchant_uuid {
getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
showContent()
}
} else {
let appUuid = getAppUuid()
// 2a6adade35f1484994a3d4c8f006b909 category is for SM only
var categoryUuids = [""]
if (self.isMarket == true) {
categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? ["2a6adade35f1484994a3d4c8f006b909"] : ["adcace6cab6049c7b7271bc85bc2b26d"]
} else {
categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? [""] : ["adcace6cab6049c7b7271bc85bc2b26d"]
}
getMultilingualMerchantsAsync(categoryUuids, false, 0.0, [], "", 0, [], getMerchantsCallback)
showContent()
}
}
func getMerchantsCallback (_ merchantsData: Array<MerchantModel>?) -> Void {
if (merchantsData != nil) {
DispatchQueue.main.async {
let filteredMerchants = (merchantsData ?? []).filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
let parentMerchants = (merchantsData ?? []).filter({ return (($0._latitude == 0.0) && ($0._longitude == 0.0)) })
// if (self.isMarket == true) {
self.merchantsArray = filteredMerchants
self.parentMerchantsArray = parentMerchants
// if let parent = (merchantsData ?? []).first(where: {(($0._latitude == 0.0) && ($0._longitude == 0.0))}) {
// self.parentMerchant = parent
// }
// } else {
// self.merchantsArray = merchantsData ?? []
// }
self.loadMapPins()
// let filteredMerchants = self.merchantsArray.filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
if (filteredMerchants.count == 0) {
self.showDialog("Καταστήματα συνεργάτη", "Ο συνεργάτης διαθέτει μόνο ηλεκτρονικό κατάστημα για ηλεκτρονικές παραγγελίες.")
}
}
return
}
}
func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
switch action.style{
case .default:
self.navigationController?.popViewController(animated: true)
// self.dismiss(animated: true, completion: {})
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
})
// cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
alert.addAction(cancelButton)
alert.addAction(UIAlertAction(title: "Δες το eshop", style: .default, handler: { action in
switch action.style{
case .default:
if (self.coupon != nil) {
// if let merchantUuid: String = self.coupon?.merchant_uuid {
// for item in swiftApi().getMerchantList() {
// if (item._uuid == merchantUuid) {
// let eshopWebsite = item._website
// if (eshopWebsite != "") {
// guard let websiteUrl = URL(string: eshopWebsite) else {
// print("Error creating URL")
// return
// }
// // check if link can be opened.
// guard UIApplication.shared.canOpenURL(websiteUrl) else {
// return
// }
// swiftApi().logTrackersEvent("click", "SeeShopWebsite")
// UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
// break;
// }
// }
// }
// }
let merchantDetails: MerchantModel? = self.coupon?.merchant_details
let eshopWebsite = merchantDetails?._website ?? ""
if (eshopWebsite != "") {
guard let websiteUrl = URL(string: eshopWebsite) else {
print("Error creating URL")
return
}
// check if link can be opened.
guard UIApplication.shared.canOpenURL(websiteUrl) else {
return
}
// logTrackersEvent("click", "SeeShopWebsite")
UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
break;
}
}
// if (self.merchantsArray.count > 0) {
// for item in self.merchantsArray {
// let eshopWebsite = item._website
//
// if (eshopWebsite != "") {
// guard let websiteUrl = URL(string: eshopWebsite) else {
// print("Error creating URL")
// return
// }
//
// // check if link can be opened.
// guard UIApplication.shared.canOpenURL(websiteUrl) else {
// return
// }
//
// swiftApi().logTrackersEvent("click", "SeeShopWebsite")
// UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
// break;
// }
// }
// }
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}
}))
self.present(alert, animated: true, completion: nil)
}
private func showLoading() {
loading = true
}
private func showError() {
}
private func showContent() {
loading = false
}
// private
@IBAction func closeButtonAction(_ sender: Any) {
print("closeButton Pressed!!!")
hidePinDetailsView()
let selectedAnnotations = mapView.selectedAnnotations
for annotation in selectedAnnotations {
mapView.deselectAnnotation(annotation, animated: false)
}
}
@IBAction func directionsButtomAction(_ sender: Any) {
guard let lon = selectedMerchant?._longitude, let lat = selectedMerchant?._latitude else {
return
}
// guard your URL instances
// guard let googleMapsUrl = URL(string: String(format: "https://www.google.com/maps/@%.6f,%.6f,6z", lat, lon)),
// let appleMapsUrl = URL(string: String(format: "http://maps.apple.com/?ll=%.6f,%.6f", lat, lon)) else {
// print("Error creating URLs")
// return
// }
// guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
// let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
// print("Error creating URLs")
// return
// }
//
// // check if link can be opened with google maps.
// guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
// UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
// return
// }
//
// UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
guard let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
print("Error creating URLs")
return
}
UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
}
private func loadMapPins() {
for item in merchantsArray {
let pin = MerchantAnnotation(item)
mapView.addAnnotation(pin)
// self.annotationGroup.append(pin)
// self.mapView.addAnnotations(self.annotationGroup)
// self.mapView.showAnnotations(self.annotationGroup, animated: true)
// let annotation = MKPointAnnotation()
// annotation.coordinate.longitude = item._longitude
// annotation.coordinate.latitude = item._latitude
// annotation.title = item._admin_name //This is the line to remove the optional annotation.title? from.
// annotation.subtitle = item._admin_name
// self.annotationGroup.append(annotation)
// self.mapView.addAnnotations(self.annotationGroup)
// self.mapView.showAnnotations(self.annotationGroup, animated: true)
// let annotation = MKPointAnnotation()
// let centerCoordinate = CLLocationCoordinate2D(latitude: item._latitude, longitude: item._longitude)
// annotation.coordinate = centerCoordinate
// annotation.title = "Pass Title here"
// mapView.addAnnotation(annotation)
}
// mapView.showAnnotations(mapView.annotations, animated: true)
}
private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
self.selectedMerchant = annotation.model
if let parent = self.parentMerchantsArray.first(where: {($0._uuid == self.selectedMerchant?._parent)}) {
self.parentMerchant = parent
}
// self.titleView.text = self.selectedMerchant?._admin_name
self.titleView.text = self.parentMerchant?._admin_name
if (self.isMarket == true) {
self.nameImageView.load(link: self.parentMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
} else {
self.nameImageView.load(link: self.selectedMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
}
self.nameView.text = self.selectedMerchant?._name
// TODO: Make dynamic
self.hoursView.text = ""
self.phoneView.text = self.selectedMerchant?._telephone
self.addressView.text = self.selectedMerchant?._address
}
private func showPinDetailsView() {
self.infoTopConstraint.constant = -320
UIView.animate(withDuration: 1.0) {
self.view.layoutIfNeeded()
}
}
private func hidePinDetailsView() {
self.selectedMerchant = nil
self.infoTopConstraint.constant = 0
UIView.animate(withDuration: 1.0) {
self.view.layoutIfNeeded()
}
}
// map view delegate
// public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
//
//// guard !(annotation is MKUserLocation) else {
//// return nil
//// }
//
// var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
// if (annotationView == nil) {
// print("=== annotationView == nil ===")
//
// annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
// annotationView?.canShowCallout = false
// } else {
// print("=== annotationView != nil ===")
//
// annotationView?.annotation = annotation
// }
//
// // TODO: add custom pin image?
// //annotationView?.image = UIImage(named: "custom")
//
// print("=== returned annotation ===")
// print(annotation)
//
// return annotationView
// }
// map view delegate
public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
// guard !(annotation is MKUserLocation) else {
// return nil
// }
var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
if (annotationView == nil) {
annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
annotationView?.canShowCallout = false
} else {
annotationView?.annotation = annotation
}
// Add custom pin image
annotationView?.frame = CGRect(x: 0, y: 0, width: 45, height: 60)
let pinImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 45, height: 60))
pinImageView.contentMode = .scaleAspectFit
if let pinImg = UIImage(named: "map_pin", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) {
pinImageView.image = pinImg
}
let logoImageView = UIImageView(frame: CGRect(x: 5, y: 5, width: 35, height: 35))
logoImageView.contentMode = .scaleAspectFit
let merchant = annotation as? MerchantAnnotation
if let merchantModel = merchant?.model {
let currentMerchant = merchantModel
if (self.isMarket == true) {
if let parent = self.parentMerchantsArray.first(where: {($0._uuid == currentMerchant._parent)}) {
let currentMerchantParent = parent
logoImageView.load(link: currentMerchantParent._img_preview , placeholder: UIImage(), cache: URLCache())
pinImageView.addSubview(logoImageView)
annotationView?.addSubview(pinImageView)
return annotationView
} else {
return nil
}
} else {
logoImageView.load(link: currentMerchant._img_preview , placeholder: UIImage(), cache: URLCache())
pinImageView.addSubview(logoImageView)
annotationView?.addSubview(pinImageView)
return annotationView
}
} else {
return nil
}
}
public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
let merchant = view.annotation as? MerchantAnnotation
let merchantModel = merchant!.model
// logTrackersEvent("click", ("ShopsScreenMarker:" + (merchantModel._uuid)))
loadPinDetailsView(merchant!)
showPinDetailsView()
}
public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
hidePinDetailsView()
}
}
private extension MKMapView {
func centerToLocation(_ location: CLLocation, regionRadius: CLLocationDistance = 1000) {
let coordinateRegion = MKCoordinateRegion(
center: location.coordinate,
latitudinalMeters: regionRadius,
longitudinalMeters: regionRadius)
setRegion(coordinateRegion, animated: true)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="24506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapViewController" customModule="SwiftWarplyFramework" customModuleProvider="target">
<connections>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hCU-aG-ygY" userLabel="Main View">
<rect key="frame" x="0.0" y="118" width="393" height="734"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="9Ss-50-8lb">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
</imageView>
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="YL5-4p-PKK">
<rect key="frame" x="0.0" y="0.0" width="393" height="734"/>
</mapView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wO4-b0-Lbj">
<rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="wO4-b0-Lbj" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="7Sp-xV-6LO"/>
<constraint firstAttribute="bottom" secondItem="YL5-4p-PKK" secondAttribute="bottom" id="AXy-Mh-nYV"/>
<constraint firstItem="wO4-b0-Lbj" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="Gfx-j2-M85"/>
<constraint firstAttribute="bottom" secondItem="9Ss-50-8lb" secondAttribute="bottom" id="Ou1-x0-kmw"/>
<constraint firstAttribute="trailing" secondItem="9Ss-50-8lb" secondAttribute="trailing" id="WVl-E8-L8A"/>
<constraint firstItem="YL5-4p-PKK" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="Zit-4v-Yuu"/>
<constraint firstItem="9Ss-50-8lb" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="miC-Sr-KkR"/>
<constraint firstAttribute="trailing" secondItem="YL5-4p-PKK" secondAttribute="trailing" id="nif-Bx-zgh"/>
<constraint firstItem="YL5-4p-PKK" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="pyA-tM-UhQ"/>
<constraint firstItem="9Ss-50-8lb" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="qVD-4w-XZ6"/>
<constraint firstAttribute="trailing" secondItem="wO4-b0-Lbj" secondAttribute="trailing" id="urK-JF-3MF"/>
</constraints>
<variation key="default">
<mask key="subviews">
<exclude reference="9Ss-50-8lb"/>
<exclude reference="wO4-b0-Lbj"/>
</mask>
</variation>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PAK-cJ-dw4">
<rect key="frame" x="0.0" y="532" width="383" height="320"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="INTERSPORT" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1JT-2j-Bcy" userLabel="Title">
<rect key="frame" x="30" y="20" width="273" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="5TE-up-pRD"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aQV-3K-z4j" userLabel="Close">
<rect key="frame" x="323" y="15" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="AUj-eK-kSi"/>
<constraint firstAttribute="width" constant="40" id="uQ2-Oz-rWC"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="B" image="ic_close_3">
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ttk-zQ-KM4" userLabel="LineTop">
<rect key="frame" x="10" y="6" width="363" height="1"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="8D8-Xt-Lbv"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="B7q-yf-o88" userLabel="NameLogo">
<rect key="frame" x="30" y="32" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="7nf-hY-Ezk"/>
<constraint firstAttribute="height" constant="30" id="sjS-02-Eub"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Intersport Χαλανδρίου" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wX9-ST-8UI" userLabel="NameLabel">
<rect key="frame" x="70" y="26.333333333333371" width="283" height="21.666666666666671"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eMM-ae-vGC" userLabel="LineMiddle">
<rect key="frame" x="10" y="87" width="363" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="3CO-Ko-Rxt"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="WN7-4d-O1d" userLabel="phoneIcon">
<rect key="frame" x="30" y="118" width="20" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="Lpw-Ge-h4I"/>
<constraint firstAttribute="height" constant="20" id="zim-Kg-KKG"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="210-6230543" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BeV-ne-dq3" userLabel="phoneLabel">
<rect key="frame" x="60" y="108" width="293" height="40"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fWk-DO-FiO" userLabel="LineBottom">
<rect key="frame" x="10" y="168" width="363" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="NeA-5u-IqP"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Xew-2M-gI6" userLabel="AddressIcon">
<rect key="frame" x="30" y="200.66666666666663" width="20" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="20" id="HNo-mc-jiJ"/>
<constraint firstAttribute="height" constant="20" id="MO8-KX-QOl"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="ΕΘΝΙΚΗΣ ΑΝΤΙΣΤΑΣΕΩΣ 4 41" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="j0g-29-RGB" userLabel="AddressLabel">
<rect key="frame" x="60.000000000000014" y="189" width="210.33333333333337" height="43"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qDd-Yd-pTP" userLabel="Directions">
<rect key="frame" x="309" y="193.66666666666663" width="54" height="34"/>
<constraints>
<constraint firstAttribute="height" constant="34" id="LpN-v7-Yp6"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Button"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wd5-lH-XLv" userLabel="HoursLabel">
<rect key="frame" x="70" y="46.333333333333371" width="283" height="21.666666666666671"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" systemColor="systemGray2Color"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="A8T-mq-RUc"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="A8T-mq-RUc" firstAttribute="bottom" secondItem="j0g-29-RGB" secondAttribute="bottom" constant="20" id="47W-TC-Iq6"/>
<constraint firstItem="j0g-29-RGB" firstAttribute="top" secondItem="fWk-DO-FiO" secondAttribute="bottom" constant="20" id="6At-pO-qxn"/>
<constraint firstAttribute="trailing" secondItem="ttk-zQ-KM4" secondAttribute="trailing" constant="10" id="6Yz-PW-jBT"/>
<constraint firstItem="Wd5-lH-XLv" firstAttribute="leading" secondItem="B7q-yf-o88" secondAttribute="trailing" constant="10" id="99N-6y-XYD"/>
<constraint firstAttribute="height" constant="320" id="9Qa-uY-9oN"/>
<constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="Wd5-lH-XLv" secondAttribute="trailing" constant="30" id="EVS-vi-TZw"/>
<constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="wX9-ST-8UI" secondAttribute="trailing" constant="30" id="G5V-tS-T1m"/>
<constraint firstItem="aQV-3K-z4j" firstAttribute="centerY" secondItem="1JT-2j-Bcy" secondAttribute="centerY" id="Gw5-PM-T9X"/>
<constraint firstItem="WN7-4d-O1d" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="30" id="Hgy-Bh-wq2"/>
<constraint firstAttribute="trailing" secondItem="aQV-3K-z4j" secondAttribute="trailing" constant="20" id="JC7-MR-KYu"/>
<constraint firstAttribute="trailing" secondItem="eMM-ae-vGC" secondAttribute="trailing" constant="10" id="R6c-03-SFe"/>
<constraint firstAttribute="trailing" secondItem="qDd-Yd-pTP" secondAttribute="trailing" constant="20" id="Rvz-pu-eQS"/>
<constraint firstItem="wX9-ST-8UI" firstAttribute="centerY" secondItem="B7q-yf-o88" secondAttribute="centerY" constant="-10" id="TaR-Lf-ecG"/>
<constraint firstItem="1JT-2j-Bcy" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="30" id="Un6-Bn-5Cx"/>
<constraint firstItem="aQV-3K-z4j" firstAttribute="leading" secondItem="1JT-2j-Bcy" secondAttribute="trailing" constant="20" id="VTK-Ig-jcY"/>
<constraint firstItem="eMM-ae-vGC" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="10" id="Xls-Sc-nMR"/>
<constraint firstItem="fWk-DO-FiO" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="10" id="Yaq-Wm-Sh1"/>
<constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="fWk-DO-FiO" secondAttribute="trailing" constant="10" id="Zf9-Hq-LZ8"/>
<constraint firstItem="WN7-4d-O1d" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="30" id="as8-NK-hDO"/>
<constraint firstItem="Xew-2M-gI6" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="30" id="c0U-1m-JLn"/>
<constraint firstItem="wX9-ST-8UI" firstAttribute="leading" secondItem="B7q-yf-o88" secondAttribute="trailing" constant="10" id="cIZ-6l-6Ol"/>
<constraint firstItem="fWk-DO-FiO" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="80" id="cnB-9w-nVf"/>
<constraint firstItem="B7q-yf-o88" firstAttribute="top" secondItem="ttk-zQ-KM4" secondAttribute="bottom" constant="25" id="crk-rS-ZoA"/>
<constraint firstItem="qDd-Yd-pTP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="j0g-29-RGB" secondAttribute="trailing" constant="10" id="d0S-Hk-REY"/>
<constraint firstItem="fWk-DO-FiO" firstAttribute="top" secondItem="BeV-ne-dq3" secondAttribute="bottom" constant="20" id="flV-RP-wgV"/>
<constraint firstItem="eMM-ae-vGC" firstAttribute="top" secondItem="B7q-yf-o88" secondAttribute="bottom" constant="25" id="hcA-zV-gd7"/>
<constraint firstItem="ttk-zQ-KM4" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="10" id="ie0-ev-rxM"/>
<constraint firstItem="1JT-2j-Bcy" firstAttribute="top" secondItem="PAK-cJ-dw4" secondAttribute="top" constant="20" id="nFl-w9-iVo"/>
<constraint firstItem="BeV-ne-dq3" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="20" id="pAF-w8-eMj"/>
<constraint firstItem="BeV-ne-dq3" firstAttribute="leading" secondItem="WN7-4d-O1d" secondAttribute="trailing" constant="10" id="qPP-Zp-wrA"/>
<constraint firstItem="Wd5-lH-XLv" firstAttribute="centerY" secondItem="B7q-yf-o88" secondAttribute="centerY" constant="10" id="sqY-g0-XMg"/>
<constraint firstItem="j0g-29-RGB" firstAttribute="leading" secondItem="Xew-2M-gI6" secondAttribute="trailing" constant="10" id="t8V-Kc-8HZ"/>
<constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="BeV-ne-dq3" secondAttribute="trailing" constant="30" id="wsg-Mj-539"/>
<constraint firstItem="eMM-ae-vGC" firstAttribute="top" secondItem="ttk-zQ-KM4" secondAttribute="bottom" constant="80" id="y7y-DL-xvl"/>
<constraint firstItem="qDd-Yd-pTP" firstAttribute="centerY" secondItem="j0g-29-RGB" secondAttribute="centerY" id="yw7-yu-Zsa"/>
<constraint firstItem="B7q-yf-o88" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="30" id="zcl-DE-MxY"/>
<constraint firstItem="qDd-Yd-pTP" firstAttribute="centerY" secondItem="Xew-2M-gI6" secondAttribute="centerY" id="zeL-xW-rr8"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="hCU-aG-ygY" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="GKy-gM-hNB"/>
<constraint firstAttribute="trailing" secondItem="PAK-cJ-dw4" secondAttribute="trailing" constant="10" id="GNw-9D-9VJ"/>
<constraint firstAttribute="bottom" secondItem="hCU-aG-ygY" secondAttribute="bottom" id="GSk-ie-S3S"/>
<constraint firstAttribute="trailing" secondItem="hCU-aG-ygY" secondAttribute="trailing" id="J99-rM-YFP"/>
<constraint firstAttribute="bottom" secondItem="PAK-cJ-dw4" secondAttribute="bottom" id="Rbp-ec-95P"/>
<constraint firstItem="PAK-cJ-dw4" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="RpT-Pg-Mld"/>
<constraint firstItem="hCU-aG-ygY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Tgj-nb-Tww"/>
</constraints>
<point key="canvasLocation" x="65" y="154"/>
</view>
</objects>
<resources>
<image name="coupons_scrollview_white" width="214" height="462"/>
<image name="ic_address" width="12.5" height="17"/>
<image name="ic_close_3" width="11.333333015441895" height="11.666666984558105"/>
<image name="ic_phone" width="15.5" height="15.5"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGray2Color">
<color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
//
// MerchantAnnotation.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 17/3/26.
//
import Foundation
import MapKit
@objc public class MerchantAnnotation: NSObject, MKAnnotation {
let model: MerchantModel
public let coordinate: CLLocationCoordinate2D
init(_ model: MerchantModel) {
self.model = model
self.coordinate = CLLocationCoordinate2D(latitude: model._latitude, longitude: model._longitude)
super.init()
}
}