Manos Chorianopoulos

Added MapsViewController

Showing 19 changed files with 645 additions and 1 deletions
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
24 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */; }; 24 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */; };
25 1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */; }; 25 1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */; };
26 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; }; 26 1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
27 + 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */; };
28 + 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */; };
29 + 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */; };
30 + 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */; };
27 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; }; 31 7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
28 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; }; 32 A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
29 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; }; 33 A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
...@@ -179,6 +183,10 @@ ...@@ -179,6 +183,10 @@
179 1EB5F4C728536FD60016F36E /* StepsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepsViewController.swift; sourceTree = "<group>"; }; 183 1EB5F4C728536FD60016F36E /* StepsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepsViewController.swift; sourceTree = "<group>"; };
180 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; }; 184 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
181 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; }; 185 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; };
186 + 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSMButton.swift; sourceTree = "<group>"; };
187 + 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; };
188 + 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; };
189 + 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
182 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; }; 190 A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
183 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; }; 191 A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
184 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; }; 192 A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
...@@ -430,6 +438,7 @@ ...@@ -430,6 +438,7 @@
430 E6A77850282933340045BBA8 /* SwiftWarplyFramework */ = { 438 E6A77850282933340045BBA8 /* SwiftWarplyFramework */ = {
431 isa = PBXGroup; 439 isa = PBXGroup;
432 children = ( 440 children = (
441 + 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */,
433 1E108A9728A3FA9B0008B8E7 /* Info.plist */, 442 1E108A9728A3FA9B0008B8E7 /* Info.plist */,
434 1E108A8B28A3F8FF0008B8E7 /* Resources */, 443 1E108A8B28A3F8FF0008B8E7 /* Resources */,
435 A02F34042882B6E60086465F /* TelcoViewController.swift */, 444 A02F34042882B6E60086465F /* TelcoViewController.swift */,
...@@ -465,6 +474,9 @@ ...@@ -465,6 +474,9 @@
465 E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */, 474 E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */,
466 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */, 475 E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */,
467 E6A77A37282BC3530045BBA8 /* Media.xcassets */, 476 E6A77A37282BC3530045BBA8 /* Media.xcassets */,
477 + 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */,
478 + 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */,
479 + 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */,
468 ); 480 );
469 path = SwiftWarplyFramework; 481 path = SwiftWarplyFramework;
470 sourceTree = "<group>"; 482 sourceTree = "<group>";
...@@ -814,6 +826,7 @@ ...@@ -814,6 +826,7 @@
814 E6A778E5282933E60045BBA8 /* Main.storyboard in Resources */, 826 E6A778E5282933E60045BBA8 /* Main.storyboard in Resources */,
815 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */, 827 1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */,
816 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */, 828 1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */,
829 + 1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */,
817 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */, 830 E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */,
818 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */, 831 1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */,
819 E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */, 832 E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */,
...@@ -901,8 +914,10 @@ ...@@ -901,8 +914,10 @@
901 E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */, 914 E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */,
902 1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */, 915 1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */,
903 E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */, 916 E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */,
917 + 1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */,
904 A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */, 918 A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */,
905 E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */, 919 E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */,
920 + 1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */,
906 E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */, 921 E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */,
907 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */, 922 E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */,
908 E6A77938282933E70045BBA8 /* AFImageDownloader.m in Sources */, 923 E6A77938282933E70045BBA8 /* AFImageDownloader.m in Sources */,
...@@ -924,6 +939,7 @@ ...@@ -924,6 +939,7 @@
924 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */, 939 1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */,
925 E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */, 940 E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */,
926 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */, 941 E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */,
942 + 1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */,
927 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */, 943 E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */,
928 A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */, 944 A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */,
929 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */, 945 E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */,
......
1 +//
2 +// CSMButton.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 20/9/22.
6 +//
7 +
8 +import UIKit
9 +
10 +// @IBDesignable
11 +@objc public class CSMButton: UIButton {
12 + required init?(coder aDecoder: NSCoder) {
13 + super.init(coder: aDecoder)
14 + configure()
15 + }
16 + override init(frame: CGRect = .zero) {
17 + super.init(frame: frame)
18 + configure()
19 + }
20 +
21 + public override func prepareForInterfaceBuilder() {
22 + super.prepareForInterfaceBuilder()
23 + configure()
24 + }
25 +}
26 +
27 +private extension CSMButton {
28 + func configure() {
29 + setImage(UIImage(named: "directions"), for: .normal)
30 + titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
31 + setTitleColor(.white, for: .normal)
32 + backgroundColor = UIColor(rgb: 0x79BF14)
33 + layer.cornerRadius = 12.0
34 +
35 + imageEdgeInsets = UIEdgeInsets(top:0.0, left:0.0, bottom:0.0, right:5.0);
36 + titleEdgeInsets = UIEdgeInsets(top:0.0, left:5.0, bottom:0.0, right:0.0);
37 + }
38 +}
...@@ -252,6 +252,8 @@ import AVFoundation ...@@ -252,6 +252,8 @@ import AVFoundation
252 } 252 }
253 253
254 @IBAction func mapButtonAction(_ sender: Any) { 254 @IBAction func mapButtonAction(_ sender: Any) {
255 - // TODO: open MapVC 255 + let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
256 + vc.couponSet = coupon?.couponset_data
257 + self.navigationController?.pushViewController(vc, animated: true)
256 } 258 }
257 } 259 }
......
1 +//
2 +// MapsViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 20/9/22.
6 +//
7 +
8 +import UIKit
9 +import MapKit
10 +
11 +@objc public class MapsViewController: UIViewController, MKMapViewDelegate {
12 + // ui
13 + @IBOutlet weak var backgroundImage: UIImageView!
14 + @IBOutlet private var mapView: MKMapView!
15 +
16 + @IBOutlet weak var closeButton: UIButton!
17 + @IBOutlet private var titleView: UILabel!
18 + @IBOutlet private var nameImageView: UIImageView!
19 + @IBOutlet private var nameView: UILabel!
20 + @IBOutlet private var hoursView: UILabel!
21 + @IBOutlet private var phoneView: UILabel!
22 + @IBOutlet private var addressView: UILabel!
23 + @IBOutlet private var directionsButton: CSMButton!
24 + @IBOutlet private var infoTopConstraint: NSLayoutConstraint!
25 +
26 + // public
27 + public var couponSet: swiftApi.CouponSetItemModel?
28 + var merchantsArray:Array<swiftApi.MerchantModel> = []
29 + var selectedMerchant: swiftApi.MerchantModel?
30 + var annotationGroup = [MKPointAnnotation]()
31 +
32 + //
33 + var loading: Bool = false
34 + let initialLocation = CLLocation(latitude: 37.9641262, longitude: 23.7468592) // greece
35 + //
36 + public override func viewDidLoad() {
37 + super.viewDidLoad()
38 +
39 + self.hidesBottomBarWhenPushed = true
40 +
41 + self.infoTopConstraint.constant = 0
42 +
43 + setBackButton()
44 + setNavigationTitle("Καταστήματα")
45 +
46 + backgroundImage.image = UIImage(named: "coupons_scrollview_white")
47 +
48 + mapView.delegate = self
49 + mapView.centerToLocation(initialLocation, regionRadius: 1000000)
50 +
51 + mapView.clipsToBounds = true
52 + mapView.layer.cornerRadius = 30
53 + mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
54 +
55 +
56 + closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
57 +
58 + titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
59 + titleView.textColor = UIColor(rgb: 0x757575)
60 +
61 + nameView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
62 + nameView.textColor = UIColor(rgb: 0x415564)
63 +
64 + hoursView.font = UIFont(name: "PFSquareSansPro-Regular", size: 18)
65 + hoursView.textColor = UIColor(rgb: 0xAEAEAE)
66 +
67 + hoursView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
68 + hoursView.textColor = UIColor(rgb: 0x415564)
69 +
70 + addressView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
71 + addressView.textColor = UIColor(rgb: 0x415564)
72 +
73 + //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
74 + directionsButton.setTitle("Οδηγίες", for: .normal)
75 + directionsButton.setImage(UIImage(named: "ic_directions"), for: .normal)
76 +
77 +// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
78 +// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
79 +// directionsButton.sizeToFit()
80 + //directionsButton.setTitleColor(.white, for: .normal)
81 + //directionsButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
82 + //directionsButton.layer.cornerRadius = 12.0
83 +
84 + load()
85 + }
86 +
87 + // mvp
88 + @objc func load() {
89 +
90 + if (loading) {
91 + return;
92 + }
93 + showLoading()
94 +
95 + if (couponSet != nil) {
96 + if let merchantUuid: String = couponSet?.merchant_uuid {
97 + swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
98 + showContent()
99 + }
100 + }
101 +
102 + }
103 +
104 + func getMerchantsCallback (_ merchantsData: Array<swiftApi.MerchantModel>?) -> Void {
105 + if (merchantsData != nil) {
106 + DispatchQueue.main.async {
107 +
108 + self.merchantsArray = merchantsData ?? []
109 + self.loadMapPins()
110 + }
111 +
112 + return
113 + }
114 + }
115 +
116 + private func showLoading() {
117 +
118 + loading = true
119 + }
120 +
121 + private func showError() {
122 + }
123 +
124 + private func showContent() {
125 +
126 + loading = false
127 + }
128 +
129 + // private
130 + @IBAction func closeButtonAction(_ sender: Any) {
131 + print("closeButton Pressed!!!")
132 + hidePinDetailsView()
133 +
134 + let selectedAnnotations = mapView.selectedAnnotations
135 + for annotation in selectedAnnotations {
136 + mapView.deselectAnnotation(annotation, animated: false)
137 + }
138 + }
139 +
140 + @IBAction func directionsButtomAction(_ sender: Any) {
141 +
142 + guard let lon = selectedMerchant?._longitude, let lat = selectedMerchant?._latitude else {
143 + return
144 + }
145 +
146 + // guard your URL instances
147 +// guard let googleMapsUrl = URL(string: String(format: "https://www.google.com/maps/@%.6f,%.6f,6z", lat, lon)),
148 +// let appleMapsUrl = URL(string: String(format: "http://maps.apple.com/?ll=%.6f,%.6f", lat, lon)) else {
149 +// print("Error creating URLs")
150 +// return
151 +// }
152 +
153 + guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
154 + let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
155 + print("Error creating URLs")
156 + return
157 + }
158 +
159 + // check if link can be opened with google maps.
160 + guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
161 + UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
162 + return
163 + }
164 +
165 + UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
166 +
167 + }
168 +
169 + private func loadMapPins() {
170 + for item in merchantsArray {
171 + let pin = MerchantAnnotation(item)
172 + mapView.addAnnotation(pin)
173 +
174 +// self.annotationGroup.append(pin)
175 +// self.mapView.addAnnotations(self.annotationGroup)
176 +// self.mapView.showAnnotations(self.annotationGroup, animated: true)
177 +
178 +// let annotation = MKPointAnnotation()
179 +// annotation.coordinate.longitude = item._longitude
180 +// annotation.coordinate.latitude = item._latitude
181 +// annotation.title = item._admin_name //This is the line to remove the optional annotation.title? from.
182 +// annotation.subtitle = item._admin_name
183 +// self.annotationGroup.append(annotation)
184 +// self.mapView.addAnnotations(self.annotationGroup)
185 +// self.mapView.showAnnotations(self.annotationGroup, animated: true)
186 +
187 +// let annotation = MKPointAnnotation()
188 +// let centerCoordinate = CLLocationCoordinate2D(latitude: item._latitude, longitude: item._longitude)
189 +// annotation.coordinate = centerCoordinate
190 +// annotation.title = "Pass Title here"
191 +// mapView.addAnnotation(annotation)
192 + }
193 +// mapView.showAnnotations(mapView.annotations, animated: true)
194 + }
195 +
196 + private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
197 + self.selectedMerchant = annotation.model
198 +
199 + self.titleView.text = self.selectedMerchant?._admin_name
200 + self.nameImageView.load(link: self.selectedMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
201 + self.nameView.text = self.selectedMerchant?._name
202 + // TODO: Make dynamic
203 + self.hoursView.text = ""
204 + self.phoneView.text = self.selectedMerchant?._telephone
205 + self.addressView.text = self.selectedMerchant?._address
206 + }
207 +
208 + private func showPinDetailsView() {
209 + self.infoTopConstraint.constant = -320
210 + UIView.animate(withDuration: 1.0) {
211 + self.view.layoutIfNeeded()
212 + }
213 + }
214 +
215 + private func hidePinDetailsView() {
216 + self.selectedMerchant = nil
217 +
218 + self.infoTopConstraint.constant = 0
219 + UIView.animate(withDuration: 1.0) {
220 + self.view.layoutIfNeeded()
221 + }
222 + }
223 +
224 + // map view delegate
225 +// public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
226 +//
227 +//// guard !(annotation is MKUserLocation) else {
228 +//// return nil
229 +//// }
230 +//
231 +// var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
232 +// if (annotationView == nil) {
233 +// print("=== annotationView == nil ===")
234 +//
235 +// annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
236 +// annotationView?.canShowCallout = false
237 +// } else {
238 +// print("=== annotationView != nil ===")
239 +//
240 +// annotationView?.annotation = annotation
241 +// }
242 +//
243 +// // TODO: add custom pin image?
244 +// //annotationView?.image = UIImage(named: "custom")
245 +//
246 +// print("=== returned annotation ===")
247 +// print(annotation)
248 +//
249 +// return annotationView
250 +// }
251 +
252 + public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
253 + let merchant = view.annotation as? MerchantAnnotation
254 + loadPinDetailsView(merchant!)
255 + showPinDetailsView()
256 + }
257 +
258 + public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
259 + hidePinDetailsView()
260 + }
261 +}
262 +
263 +private extension MKMapView {
264 +
265 + func centerToLocation(_ location: CLLocation, regionRadius: CLLocationDistance = 1000) {
266 + let coordinateRegion = MKCoordinateRegion(
267 + center: location.coordinate,
268 + latitudinalMeters: regionRadius,
269 + longitudinalMeters: regionRadius)
270 + setRegion(coordinateRegion, animated: true)
271 + }
272 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3 + <device id="retina6_1" orientation="portrait" appearance="light"/>
4 + <dependencies>
5 + <deployment identifier="iOS"/>
6 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
7 + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
8 + <capability name="System colors in document resources" minToolsVersion="11.0"/>
9 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10 + </dependencies>
11 + <objects>
12 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapsViewController" customModule="swift_example" customModuleProvider="target">
13 + <connections>
14 + <outlet property="addressView" destination="syP-Hv-OGD" id="LUw-pI-3va"/>
15 + <outlet property="backgroundImage" destination="tVJ-fk-ani" id="ETq-VL-6q7"/>
16 + <outlet property="closeButton" destination="lEb-V2-2FC" id="aEd-fS-pbO"/>
17 + <outlet property="directionsButton" destination="bw3-J9-wHr" id="sSi-OK-KTA"/>
18 + <outlet property="hoursView" destination="u9U-A7-lbO" id="xm5-gQ-zjh"/>
19 + <outlet property="infoTopConstraint" destination="9av-UX-8VL" id="uKX-lw-OTH"/>
20 + <outlet property="mapView" destination="F1c-ck-cQa" id="cdx-31-BiL"/>
21 + <outlet property="nameImageView" destination="eDV-A1-pOO" id="JYq-eT-kEG"/>
22 + <outlet property="nameView" destination="MsK-eg-pkk" id="60t-lm-O8m"/>
23 + <outlet property="phoneView" destination="knh-D9-CuM" id="ES2-6e-vRx"/>
24 + <outlet property="titleView" destination="oVh-dv-f7a" id="dst-Ku-EFw"/>
25 + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
26 + </connections>
27 + </placeholder>
28 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
29 + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
30 + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
31 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
32 + <subviews>
33 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rKl-bF-Zpf" userLabel="Main View">
34 + <rect key="frame" x="0.0" y="44" width="414" height="852"/>
35 + <subviews>
36 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="tVJ-fk-ani">
37 + <rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
38 + </imageView>
39 + <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="F1c-ck-cQa">
40 + <rect key="frame" x="0.0" y="2" width="414" height="850"/>
41 + </mapView>
42 + </subviews>
43 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
44 + <constraints>
45 + <constraint firstAttribute="bottom" secondItem="tVJ-fk-ani" secondAttribute="bottom" id="5cR-5W-AwC"/>
46 + <constraint firstItem="tVJ-fk-ani" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="EMb-Ay-M18"/>
47 + <constraint firstAttribute="trailing" secondItem="tVJ-fk-ani" secondAttribute="trailing" id="LLM-SY-Ejo"/>
48 + <constraint firstItem="F1c-ck-cQa" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="P7b-Km-FIn"/>
49 + <constraint firstItem="F1c-ck-cQa" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" constant="2" id="X2Z-Vc-V9u"/>
50 + <constraint firstAttribute="trailing" secondItem="F1c-ck-cQa" secondAttribute="trailing" id="dcT-Pn-T5v"/>
51 + <constraint firstItem="tVJ-fk-ani" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="eVM-4A-gJc"/>
52 + <constraint firstAttribute="bottom" secondItem="F1c-ck-cQa" secondAttribute="bottom" id="ipi-oy-9jV"/>
53 + </constraints>
54 + </view>
55 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zc1-ew-qcl">
56 + <rect key="frame" x="0.0" y="576" width="414" height="320"/>
57 + <subviews>
58 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="INTERSPORT" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oVh-dv-f7a" userLabel="Title">
59 + <rect key="frame" x="30" y="20" width="294" height="30"/>
60 + <constraints>
61 + <constraint firstAttribute="height" constant="30" id="Gf2-VN-pNV"/>
62 + </constraints>
63 + <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
64 + <nil key="textColor"/>
65 + <nil key="highlightedColor"/>
66 + </label>
67 + <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEb-V2-2FC" userLabel="Close">
68 + <rect key="frame" x="344" y="20" width="40" height="40"/>
69 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70 + <constraints>
71 + <constraint firstAttribute="width" constant="40" id="gnd-qn-qo5"/>
72 + <constraint firstAttribute="height" constant="40" id="oeu-zs-b1J"/>
73 + </constraints>
74 + <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
75 + <state key="normal" title="B" image="ic_close">
76 + <color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
77 + </state>
78 + <connections>
79 + <action selector="closeButtonAction:" destination="-1" eventType="touchUpInside" id="bIB-NN-rUr"/>
80 + </connections>
81 + </button>
82 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F55-qj-PDc" userLabel="LineTop">
83 + <rect key="frame" x="10" y="52" width="394" height="1"/>
84 + <constraints>
85 + <constraint firstAttribute="height" constant="1" id="18a-J3-UZm"/>
86 + </constraints>
87 + </view>
88 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eDV-A1-pOO" userLabel="NameLogo">
89 + <rect key="frame" x="30" y="78" width="30" height="30"/>
90 + <constraints>
91 + <constraint firstAttribute="width" constant="30" id="IjG-Iw-fIq"/>
92 + <constraint firstAttribute="height" constant="30" id="LnS-gV-hIi"/>
93 + </constraints>
94 + </imageView>
95 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Intersport Χαλανδρίου" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MsK-eg-pkk" userLabel="NameLabel">
96 + <rect key="frame" x="70" y="72.5" width="314" height="21.5"/>
97 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
98 + <nil key="textColor"/>
99 + <nil key="highlightedColor"/>
100 + </label>
101 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHs-vI-jD7" userLabel="LineMiddle">
102 + <rect key="frame" x="10" y="133" width="394" height="1"/>
103 + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
104 + <constraints>
105 + <constraint firstAttribute="height" constant="1" id="hMo-qH-T2k"/>
106 + </constraints>
107 + </view>
108 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="KhY-nt-uwH" userLabel="phoneIcon">
109 + <rect key="frame" x="30" y="164" width="20" height="20"/>
110 + <constraints>
111 + <constraint firstAttribute="height" constant="20" id="1rt-pN-Dld"/>
112 + <constraint firstAttribute="width" constant="20" id="3Rd-ir-r7Q"/>
113 + </constraints>
114 + </imageView>
115 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="210-6230543" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="knh-D9-CuM" userLabel="phoneLabel">
116 + <rect key="frame" x="60" y="154" width="324" height="40"/>
117 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
118 + <nil key="textColor"/>
119 + <nil key="highlightedColor"/>
120 + </label>
121 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sAf-f8-8jc" userLabel="LineBottom">
122 + <rect key="frame" x="10" y="214" width="394" height="1"/>
123 + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
124 + <constraints>
125 + <constraint firstAttribute="height" constant="1" id="vSP-6I-Lz6"/>
126 + </constraints>
127 + </view>
128 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Bic-c4-J9E" userLabel="AddressIcon">
129 + <rect key="frame" x="30" y="240.5" width="20" height="20"/>
130 + <constraints>
131 + <constraint firstAttribute="height" constant="20" id="A8o-MY-I6f"/>
132 + <constraint firstAttribute="width" constant="20" id="Xma-bp-6IZ"/>
133 + </constraints>
134 + </imageView>
135 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="ΕΘΝΙΚΗΣ ΑΝΤΙΣΤΑΣΕΩΣ 4 41" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="syP-Hv-OGD" userLabel="AddressLabel">
136 + <rect key="frame" x="60" y="235" width="247" height="31"/>
137 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
138 + <nil key="textColor"/>
139 + <nil key="highlightedColor"/>
140 + </label>
141 + <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions" customClass="CSMButton" customModule="swift_example" customModuleProvider="target">
142 + <rect key="frame" x="317" y="235" width="67" height="31"/>
143 + <state key="normal" title="Button"/>
144 + <buttonConfiguration key="configuration" style="plain" title="Button"/>
145 + <connections>
146 + <action selector="directionsButtomAction:" destination="-1" eventType="touchUpInside" id="nMR-Jk-Wm4"/>
147 + </connections>
148 + </button>
149 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u9U-A7-lbO" userLabel="HoursLabel">
150 + <rect key="frame" x="70" y="92.5" width="314" height="21.5"/>
151 + <fontDescription key="fontDescription" type="system" pointSize="18"/>
152 + <color key="textColor" systemColor="systemGray2Color"/>
153 + <nil key="highlightedColor"/>
154 + </label>
155 + </subviews>
156 + <viewLayoutGuide key="safeArea" id="XS2-AR-3j9"/>
157 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
158 + <constraints>
159 + <constraint firstItem="u9U-A7-lbO" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="0Z2-uE-kRe"/>
160 + <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="MsK-eg-pkk" secondAttribute="trailing" constant="30" id="1qW-i8-MRk"/>
161 + <constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="bw3-J9-wHr" secondAttribute="bottom" constant="20" id="3vm-pn-qpa"/>
162 + <constraint firstItem="lEb-V2-2FC" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="5bY-RU-ons"/>
163 + <constraint firstItem="knh-D9-CuM" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="20" id="61g-5C-XbI"/>
164 + <constraint firstItem="sAf-f8-8jc" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="10" id="7W6-cn-WdZ"/>
165 + <constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="Bic-c4-J9E" secondAttribute="centerY" id="AHw-0D-gur"/>
166 + <constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="eDV-A1-pOO" secondAttribute="bottom" constant="25" id="D8j-Qh-CHB"/>
167 + <constraint firstItem="KhY-nt-uwH" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="Dok-gZ-xf1"/>
168 + <constraint firstItem="SHs-vI-jD7" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="Lj8-XN-HTj"/>
169 + <constraint firstAttribute="trailing" secondItem="F55-qj-PDc" secondAttribute="trailing" constant="10" id="MCj-ek-cnb"/>
170 + <constraint firstAttribute="trailing" secondItem="lEb-V2-2FC" secondAttribute="trailing" constant="30" id="NcX-rr-7OU"/>
171 + <constraint firstItem="syP-Hv-OGD" firstAttribute="leading" secondItem="Bic-c4-J9E" secondAttribute="trailing" constant="10" id="Rl4-cn-VTG"/>
172 + <constraint firstAttribute="trailing" secondItem="SHs-vI-jD7" secondAttribute="trailing" constant="10" id="Smw-Bv-Qlr"/>
173 + <constraint firstItem="lEb-V2-2FC" firstAttribute="leading" secondItem="oVh-dv-f7a" secondAttribute="trailing" constant="20" id="ULP-b9-ToV"/>
174 + <constraint firstItem="MsK-eg-pkk" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="Vg7-xl-oA2"/>
175 + <constraint firstItem="bw3-J9-wHr" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="YhG-Th-URU"/>
176 + <constraint firstItem="oVh-dv-f7a" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="Zd1-SB-SlA"/>
177 + <constraint firstItem="KhY-nt-uwH" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="30" id="a6s-J0-5rJ"/>
178 + <constraint firstItem="knh-D9-CuM" firstAttribute="leading" secondItem="KhY-nt-uwH" secondAttribute="trailing" constant="10" id="aeR-MK-4WB"/>
179 + <constraint firstItem="eDV-A1-pOO" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="bkK-59-wXK"/>
180 + <constraint firstAttribute="height" constant="320" id="eIo-xG-BnE"/>
181 + <constraint firstItem="u9U-A7-lbO" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="10" id="gFw-90-gXL"/>
182 + <constraint firstItem="oVh-dv-f7a" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="gIA-8o-Pv8"/>
183 + <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="u9U-A7-lbO" secondAttribute="trailing" constant="30" id="hZz-zi-NzM"/>
184 + <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="sAf-f8-8jc" secondAttribute="trailing" constant="10" id="hn5-U5-rvW"/>
185 + <constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="80" id="htI-gJ-mSm"/>
186 + <constraint firstAttribute="trailing" secondItem="bw3-J9-wHr" secondAttribute="trailing" constant="30" id="hya-Ns-ldi"/>
187 + <constraint firstItem="Bic-c4-J9E" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="iUf-BZ-0kl"/>
188 + <constraint firstItem="F55-qj-PDc" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="jK6-2e-p3v"/>
189 + <constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="syP-Hv-OGD" secondAttribute="bottom" constant="20" id="luv-Gm-76K"/>
190 + <constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="knh-D9-CuM" secondAttribute="bottom" constant="20" id="m6I-QE-hbq"/>
191 + <constraint firstItem="eDV-A1-pOO" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="25" id="nAA-6u-CUo"/>
192 + <constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="knh-D9-CuM" secondAttribute="trailing" constant="30" id="pFB-4b-xx9"/>
193 + <constraint firstItem="MsK-eg-pkk" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="-10" id="wpA-Xv-RdU"/>
194 + <constraint firstItem="syP-Hv-OGD" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="xD6-zI-9Nl"/>
195 + <constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="80" id="xPl-UV-cMd"/>
196 + <constraint firstItem="bw3-J9-wHr" firstAttribute="leading" secondItem="syP-Hv-OGD" secondAttribute="trailing" constant="10" id="zAU-89-R2t"/>
197 + </constraints>
198 + </view>
199 + </subviews>
200 + <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
201 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
202 + <constraints>
203 + <constraint firstItem="Zc1-ew-qcl" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="0dW-tS-Vxe"/>
204 + <constraint firstItem="Zc1-ew-qcl" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="bottom" constant="-320" id="9av-UX-8VL"/>
205 + <constraint firstItem="Zc1-ew-qcl" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="LKw-N3-e8B"/>
206 + <constraint firstItem="rKl-bF-Zpf" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="W3y-NU-vli"/>
207 + <constraint firstItem="rKl-bF-Zpf" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="cMl-Pz-ulj"/>
208 + <constraint firstAttribute="bottom" secondItem="rKl-bF-Zpf" secondAttribute="bottom" id="pOF-9Z-ipf"/>
209 + <constraint firstAttribute="trailing" secondItem="rKl-bF-Zpf" secondAttribute="trailing" id="xaW-C2-dLe"/>
210 + </constraints>
211 + <point key="canvasLocation" x="137.68115942028987" y="120.53571428571428"/>
212 + </view>
213 + </objects>
214 + <resources>
215 + <image name="coupons_scrollview_white" width="214" height="462"/>
216 + <image name="ic_address" width="12.5" height="17"/>
217 + <image name="ic_close" width="17" height="17.5"/>
218 + <image name="ic_phone" width="15.5" height="15.5"/>
219 + <systemColor name="systemBackgroundColor">
220 + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
221 + </systemColor>
222 + <systemColor name="systemGray2Color">
223 + <color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
224 + </systemColor>
225 + </resources>
226 +</document>
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_pin_location.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_pin_location-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_pin_location-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_pin_compass.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_pin_compass-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_pin_compass-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_pin_tel.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_pin_tel-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_pin_tel-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +//
2 +// MerchantAnnotation.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 20/9/22.
6 +//
7 +
8 +import Foundation
9 +import MapKit
10 +
11 +@objc public class MerchantAnnotation: NSObject, MKAnnotation {
12 + let model: swiftApi.MerchantModel
13 + public let coordinate: CLLocationCoordinate2D
14 +
15 +
16 + init(_ model: swiftApi.MerchantModel) {
17 + self.model = model
18 + self.coordinate = CLLocationCoordinate2D(latitude: model._latitude, longitude: model._longitude)
19 + super.init()
20 + }
21 +}