Manos Chorianopoulos

MapViewController part1

Showing 35 changed files with 955 additions and 2 deletions
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>Pods-SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>0</integer> 10 + <integer>1</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
...@@ -73,6 +73,9 @@ ...@@ -73,6 +73,9 @@
73 1EDD0AC62E0D68B6005E162B /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 1EDD0AC52E0D68B6005E162B /* SQLite */; }; 73 1EDD0AC62E0D68B6005E162B /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 1EDD0AC52E0D68B6005E162B /* SQLite */; };
74 622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */; }; 74 622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */; };
75 622DA0AF2F51CAEE00308AB8 /* CouponsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */; }; 75 622DA0AF2F51CAEE00308AB8 /* CouponsetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */; };
76 + 626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */; };
77 + 626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 626AF6DC2F699081008BCA08 /* MapViewController.swift */; };
78 + 626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 626AF6DD2F699081008BCA08 /* MapViewController.xib */; };
76 62A0A6D32F67FEDC00508534 /* MyCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */; }; 79 62A0A6D32F67FEDC00508534 /* MyCouponsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */; };
77 62A0A6D42F67FEDC00508534 /* MyCouponsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */; }; 80 62A0A6D42F67FEDC00508534 /* MyCouponsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */; };
78 62A0A6D82F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */; }; 81 62A0A6D82F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */; };
...@@ -154,6 +157,9 @@ ...@@ -154,6 +157,9 @@
154 1EDD0ABC2E0D308A005E162B /* XIBLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XIBLoader.swift; sourceTree = "<group>"; }; 157 1EDD0ABC2E0D308A005E162B /* XIBLoader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XIBLoader.swift; sourceTree = "<group>"; };
155 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsetViewController.swift; sourceTree = "<group>"; }; 158 622DA0AC2F51CAEE00308AB8 /* CouponsetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CouponsetViewController.swift; sourceTree = "<group>"; };
156 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponsetViewController.xib; sourceTree = "<group>"; }; 159 622DA0AD2F51CAEE00308AB8 /* CouponsetViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CouponsetViewController.xib; sourceTree = "<group>"; };
160 + 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
161 + 626AF6DC2F699081008BCA08 /* MapViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapViewController.swift; sourceTree = "<group>"; };
162 + 626AF6DD2F699081008BCA08 /* MapViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapViewController.xib; sourceTree = "<group>"; };
157 62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsViewController.swift; sourceTree = "<group>"; }; 163 62A0A6D12F67FEDC00508534 /* MyCouponsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsViewController.swift; sourceTree = "<group>"; };
158 62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyCouponsViewController.xib; sourceTree = "<group>"; }; 164 62A0A6D22F67FEDC00508534 /* MyCouponsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyCouponsViewController.xib; sourceTree = "<group>"; };
159 62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsHeaderTableViewCell.swift; sourceTree = "<group>"; }; 165 62A0A6D62F680C6A00508534 /* MyCouponsHeaderTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyCouponsHeaderTableViewCell.swift; sourceTree = "<group>"; };
...@@ -331,6 +337,7 @@ ...@@ -331,6 +337,7 @@
331 1EA8E5B42DDF315600CD3418 /* screens */ = { 337 1EA8E5B42DDF315600CD3418 /* screens */ = {
332 isa = PBXGroup; 338 isa = PBXGroup;
333 children = ( 339 children = (
340 + 626AF6D92F698F96008BCA08 /* MapViewController */,
334 622DA0AB2F51CA9100308AB8 /* CouponsetViewController */, 341 622DA0AB2F51CA9100308AB8 /* CouponsetViewController */,
335 1EBE45642E02DDF90055A0D4 /* CampaignViewController */, 342 1EBE45642E02DDF90055A0D4 /* CampaignViewController */,
336 1E917CD32DDF6472002221D8 /* MyRewardsViewController */, 343 1E917CD32DDF6472002221D8 /* MyRewardsViewController */,
...@@ -449,6 +456,16 @@ ...@@ -449,6 +456,16 @@
449 path = CouponsetViewController; 456 path = CouponsetViewController;
450 sourceTree = "<group>"; 457 sourceTree = "<group>";
451 }; 458 };
459 + 626AF6D92F698F96008BCA08 /* MapViewController */ = {
460 + isa = PBXGroup;
461 + children = (
462 + 626AF6DA2F698FF1008BCA08 /* MerchantAnnotation.swift */,
463 + 626AF6DC2F699081008BCA08 /* MapViewController.swift */,
464 + 626AF6DD2F699081008BCA08 /* MapViewController.xib */,
465 + );
466 + path = MapViewController;
467 + sourceTree = "<group>";
468 + };
452 62A0A6D02F67FE8100508534 /* MyCouponsViewController */ = { 469 62A0A6D02F67FE8100508534 /* MyCouponsViewController */ = {
453 isa = PBXGroup; 470 isa = PBXGroup;
454 children = ( 471 children = (
...@@ -643,6 +660,7 @@ ...@@ -643,6 +660,7 @@
643 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */, 660 1EA8E5C02DDF427A00CD3418 /* PingLCG-Bold.otf in Resources */,
644 622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */, 661 622DA0AE2F51CAEE00308AB8 /* CouponsetViewController.xib in Resources */,
645 1E64E1832DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib in Resources */, 662 1E64E1832DE48E0600543217 /* MyRewardsOfferCollectionViewCell.xib in Resources */,
663 + 626AF6DF2F699081008BCA08 /* MapViewController.xib in Resources */,
646 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */, 664 1EA8E5C12DDF427A00CD3418 /* PingLCG-Light.otf in Resources */,
647 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */, 665 1EA8E5C22DDF427A00CD3418 /* PingLCG-Regular.otf in Resources */,
648 1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */, 666 1EB4F42B2DE0A0AF00D934C0 /* MyRewardsOffersScrollTableViewCell.xib in Resources */,
...@@ -735,8 +753,10 @@ ...@@ -735,8 +753,10 @@
735 1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */, 753 1E917CD72DDF64B2002221D8 /* MyRewardsViewController.swift in Sources */,
736 1E917CDC2DDF68C7002221D8 /* CouponViewController.swift in Sources */, 754 1E917CDC2DDF68C7002221D8 /* CouponViewController.swift in Sources */,
737 1E4C4CFB2DE6014500279AAD /* CopyableLabel.swift in Sources */, 755 1E4C4CFB2DE6014500279AAD /* CopyableLabel.swift in Sources */,
756 + 626AF6DE2F699081008BCA08 /* MapViewController.swift in Sources */,
738 1EDBAF112DE8443B00911E79 /* ProfileHeaderTableViewCell.swift in Sources */, 757 1EDBAF112DE8443B00911E79 /* ProfileHeaderTableViewCell.swift in Sources */,
739 1EDBAF052DE843CA00911E79 /* ProfileCouponTableViewCell.swift in Sources */, 758 1EDBAF052DE843CA00911E79 /* ProfileCouponTableViewCell.swift in Sources */,
759 + 626AF6DB2F698FF1008BCA08 /* MerchantAnnotation.swift in Sources */,
740 1EB4F4262DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift in Sources */, 760 1EB4F4262DE09AAC00D934C0 /* MyRewardsBannerOffersScrollTableViewCell.swift in Sources */,
741 ); 761 );
742 runOnlyForDeploymentPostprocessing = 0; 762 runOnlyForDeploymentPostprocessing = 0;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key> 7 <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 <dict> 8 <dict>
9 <key>orderHint</key> 9 <key>orderHint</key>
10 - <integer>1</integer> 10 + <integer>0</integer>
11 </dict> 11 </dict>
12 </dict> 12 </dict>
13 </dict> 13 </dict>
......
1 +{
2 + "images" : [
3 + {
4 + "filename" : "filter.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "filter 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "filter 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_close_4.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_close_4 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_close_4 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" : "map_location.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "map_location 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "map_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" : "map_navigate.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "map_navigate 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "map_navigate 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" : "map_pin.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "map_pin 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "map_pin 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" : "map_pin_2.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "map_pin_2 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "map_pin_2 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" : "map_telephone.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "map_telephone 1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "map_telephone 2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
1 +//
2 +// MapViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 17/3/26.
6 +//
7 +
8 +import UIKit
9 +import MapKit
10 +
11 +@objc public class MapViewController: UIViewController, MKMapViewDelegate {
12 + // ui
13 + @IBOutlet weak var mainView: UIView!
14 + @IBOutlet weak var backgroundImage: UIImageView!
15 + @IBOutlet private var mapView: MKMapView!
16 +
17 + @IBOutlet weak var closeButton: UIButton!
18 + @IBOutlet private var titleView: UILabel!
19 + @IBOutlet private var nameImageView: UIImageView!
20 + @IBOutlet private var nameView: UILabel!
21 + @IBOutlet private var hoursView: UILabel!
22 + @IBOutlet private var phoneView: UILabel!
23 + @IBOutlet private var addressView: UILabel!
24 + @IBOutlet private var directionsButton: UIButton!
25 + @IBOutlet private var infoTopConstraint: NSLayoutConstraint!
26 + @IBOutlet weak var topBorderLine: UIImageView!
27 + @IBOutlet weak var phoneImageView: UIImageView!
28 + @IBOutlet weak var addressImageView: UIImageView!
29 +
30 + // public
31 + public var coupon: CouponItemModel?
32 + public var isMarket: Bool? = false
33 + var merchantsArray:Array<MerchantModel> = []
34 + var selectedMerchant: MerchantModel?
35 + var annotationGroup = [MKPointAnnotation]()
36 + var parentMerchant: MerchantModel?
37 + var parentMerchantsArray:Array<MerchantModel> = []
38 +
39 + //
40 + var loading: Bool = false
41 + let initialLocation = CLLocation(latitude: 37.9641262, longitude: 23.7468592) // greece
42 + //
43 + public override func viewDidLoad() {
44 + super.viewDidLoad()
45 +
46 + self.hidesBottomBarWhenPushed = true
47 +
48 + self.infoTopConstraint.constant = 0
49 +
50 + setBackButton()
51 + setNavigationTitle("Καταστήματα")
52 +
53 + backgroundImage.image = UIImage(named: "coupons_scrollview_white", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
54 + phoneImageView.image = UIImage(named: "ic_phone", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
55 + addressImageView.image = UIImage(named: "ic_address", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
56 +
57 + mapView.delegate = self
58 + mapView.centerToLocation(initialLocation, regionRadius: 1000000)
59 +
60 +// mapView.clipsToBounds = true
61 +// mapView.layer.cornerRadius = 30
62 +// mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
63 +
64 +// let image = UIImage(named: "top_border_line", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)!
65 +// var aspectR: CGFloat = 0.0
66 +//
67 +// aspectR = image.size.width/image.size.height
68 +
69 +// topBorderLine.translatesAutoresizingMaskIntoConstraints = false
70 +// topBorderLine.image = image
71 +// topBorderLine.contentMode = .scaleAspectFill
72 +//
73 +// NSLayoutConstraint.activate([
74 +// topBorderLine.topAnchor.constraint(equalTo: mainView.topAnchor, constant: 0),
75 +// topBorderLine.leadingAnchor.constraint(equalTo: mainView.leadingAnchor, constant: 0),
76 +// topBorderLine.trailingAnchor.constraint(equalTo: mainView.trailingAnchor, constant: 0),
77 +// topBorderLine.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width),
78 +// topBorderLine.heightAnchor.constraint(equalTo: topBorderLine.widthAnchor, multiplier: 1/aspectR)
79 +// ])
80 +
81 +
82 + closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
83 + closeButton.setImage(UIImage(named: "ic_close_3", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
84 +
85 + titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
86 + titleView.textColor = UIColor(rgb: 0x757575)
87 +
88 + nameView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
89 + nameView.textColor = UIColor(rgb: 0x415564)
90 +
91 + hoursView.font = UIFont(name: "PFSquareSansPro-Regular", size: 18)
92 + hoursView.textColor = UIColor(rgb: 0xAEAEAE)
93 +
94 + hoursView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
95 + hoursView.textColor = UIColor(rgb: 0x415564)
96 +
97 + addressView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
98 + addressView.textColor = UIColor(rgb: 0x415564)
99 +
100 + //directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
101 + directionsButton.setTitle("Οδηγίες", for: .normal)
102 + directionsButton.setImage(UIImage(named: "ic_directions", in: MyEmptyClass.resourceBundle(), compatibleWith: nil), for: .normal)
103 +
104 +// directionsButton.sizeToFit()
105 + directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
106 + directionsButton.setTitleColor(.white, for: .normal)
107 + directionsButton.tintColor = .white
108 + directionsButton.backgroundColor = UIColor(rgb: 0x0E8103)
109 + directionsButton.layer.cornerRadius = 16.0
110 +// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
111 +// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
112 + directionsButton.frame = CGRect(x: 0.0, y: 0.0, width: directionsButton.intrinsicContentSize.width+10, height: 50)
113 +// directionsButton.contentEdgeInsets = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15)
114 + directionsButton.setInsets(forContentPadding: UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 15), imageTitlePadding: 10)
115 +
116 + load()
117 + }
118 +
119 + public override func viewWillAppear(_ animated: Bool) {
120 + super.viewWillAppear(animated)
121 +
122 +// logTrackersEvent("screen", "ShopsScreen")
123 +
124 + self.navigationController?.hideHairline()
125 + }
126 +
127 + // mvp
128 + @objc func load() {
129 +
130 + if (loading) {
131 + return;
132 + }
133 + showLoading()
134 +
135 + if (coupon != nil) {
136 + if let merchantUuid: String = coupon?.merchant_uuid {
137 + getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
138 + showContent()
139 + }
140 + } else {
141 + let appUuid = getAppUuid()
142 +
143 + // 2a6adade35f1484994a3d4c8f006b909 category is for SM only
144 + var categoryUuids = [""]
145 + if (self.isMarket == true) {
146 + categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? ["2a6adade35f1484994a3d4c8f006b909"] : ["adcace6cab6049c7b7271bc85bc2b26d"]
147 + } else {
148 + categoryUuids = appUuid == "0086a2088301440792091b9f814c2267" ? [""] : ["adcace6cab6049c7b7271bc85bc2b26d"]
149 + }
150 +
151 + getMultilingualMerchantsAsync(categoryUuids, false, 0.0, [], "", 0, [], getMerchantsCallback)
152 + showContent()
153 + }
154 +
155 + }
156 +
157 + func getMerchantsCallback (_ merchantsData: Array<MerchantModel>?) -> Void {
158 + if (merchantsData != nil) {
159 + DispatchQueue.main.async {
160 +
161 + let filteredMerchants = (merchantsData ?? []).filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
162 + let parentMerchants = (merchantsData ?? []).filter({ return (($0._latitude == 0.0) && ($0._longitude == 0.0)) })
163 +
164 +// if (self.isMarket == true) {
165 + self.merchantsArray = filteredMerchants
166 + self.parentMerchantsArray = parentMerchants
167 +
168 +// if let parent = (merchantsData ?? []).first(where: {(($0._latitude == 0.0) && ($0._longitude == 0.0))}) {
169 +// self.parentMerchant = parent
170 +// }
171 +
172 +// } else {
173 +// self.merchantsArray = merchantsData ?? []
174 +// }
175 +
176 + self.loadMapPins()
177 +
178 +// let filteredMerchants = self.merchantsArray.filter({ return (($0._latitude != 0.0) && ($0._longitude != 0.0)) })
179 + if (filteredMerchants.count == 0) {
180 + self.showDialog("Καταστήματα συνεργάτη", "Ο συνεργάτης διαθέτει μόνο ηλεκτρονικό κατάστημα για ηλεκτρονικές παραγγελίες.")
181 + }
182 + }
183 +
184 + return
185 + }
186 + }
187 +
188 + func showDialog(_ alertTitle: String, _ alertSubTitle: String) -> Void {
189 +
190 + let alert = UIAlertController(title: alertTitle, message: alertSubTitle, preferredStyle: .alert)
191 +
192 + let cancelButton = UIAlertAction(title: "Άκυρο", style: .default, handler: { action in
193 + switch action.style{
194 + case .default:
195 + self.navigationController?.popViewController(animated: true)
196 + // self.dismiss(animated: true, completion: {})
197 +
198 + case .cancel:
199 + print("cancel")
200 +
201 + case .destructive:
202 + print("destructive")
203 +
204 + }
205 + })
206 + // cancelButton.setValue(UIColor(rgb: 0xFC5757), forKey: "titleTextColor")
207 + alert.addAction(cancelButton)
208 +
209 + alert.addAction(UIAlertAction(title: "Δες το eshop", style: .default, handler: { action in
210 + switch action.style{
211 + case .default:
212 + if (self.coupon != nil) {
213 + // if let merchantUuid: String = self.coupon?.merchant_uuid {
214 + // for item in swiftApi().getMerchantList() {
215 + // if (item._uuid == merchantUuid) {
216 +
217 + // let eshopWebsite = item._website
218 +
219 + // if (eshopWebsite != "") {
220 + // guard let websiteUrl = URL(string: eshopWebsite) else {
221 + // print("Error creating URL")
222 + // return
223 + // }
224 +
225 + // // check if link can be opened.
226 + // guard UIApplication.shared.canOpenURL(websiteUrl) else {
227 + // return
228 + // }
229 +
230 + // swiftApi().logTrackersEvent("click", "SeeShopWebsite")
231 + // UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
232 + // break;
233 + // }
234 + // }
235 + // }
236 + // }
237 +
238 + let merchantDetails: MerchantModel? = self.coupon?.merchant_details
239 + let eshopWebsite = merchantDetails?._website ?? ""
240 +
241 + if (eshopWebsite != "") {
242 + guard let websiteUrl = URL(string: eshopWebsite) else {
243 + print("Error creating URL")
244 + return
245 + }
246 +
247 + // check if link can be opened.
248 + guard UIApplication.shared.canOpenURL(websiteUrl) else {
249 + return
250 + }
251 +
252 +// logTrackersEvent("click", "SeeShopWebsite")
253 + UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
254 + break;
255 + }
256 + }
257 +// if (self.merchantsArray.count > 0) {
258 +// for item in self.merchantsArray {
259 +// let eshopWebsite = item._website
260 +//
261 +// if (eshopWebsite != "") {
262 +// guard let websiteUrl = URL(string: eshopWebsite) else {
263 +// print("Error creating URL")
264 +// return
265 +// }
266 +//
267 +// // check if link can be opened.
268 +// guard UIApplication.shared.canOpenURL(websiteUrl) else {
269 +// return
270 +// }
271 +//
272 +// swiftApi().logTrackersEvent("click", "SeeShopWebsite")
273 +// UIApplication.shared.open(websiteUrl, options: [:], completionHandler: nil)
274 +// break;
275 +// }
276 +// }
277 +// }
278 +
279 + case .cancel:
280 + print("cancel")
281 +
282 + case .destructive:
283 + print("destructive")
284 +
285 + }
286 + }))
287 + self.present(alert, animated: true, completion: nil)
288 + }
289 +
290 + private func showLoading() {
291 +
292 + loading = true
293 + }
294 +
295 + private func showError() {
296 + }
297 +
298 + private func showContent() {
299 +
300 + loading = false
301 + }
302 +
303 + // private
304 + @IBAction func closeButtonAction(_ sender: Any) {
305 + print("closeButton Pressed!!!")
306 + hidePinDetailsView()
307 +
308 + let selectedAnnotations = mapView.selectedAnnotations
309 + for annotation in selectedAnnotations {
310 + mapView.deselectAnnotation(annotation, animated: false)
311 + }
312 + }
313 +
314 + @IBAction func directionsButtomAction(_ sender: Any) {
315 +
316 + guard let lon = selectedMerchant?._longitude, let lat = selectedMerchant?._latitude else {
317 + return
318 + }
319 +
320 + // guard your URL instances
321 +// guard let googleMapsUrl = URL(string: String(format: "https://www.google.com/maps/@%.6f,%.6f,6z", lat, lon)),
322 +// let appleMapsUrl = URL(string: String(format: "http://maps.apple.com/?ll=%.6f,%.6f", lat, lon)) else {
323 +// print("Error creating URLs")
324 +// return
325 +// }
326 +
327 +// guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
328 +// let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
329 +// print("Error creating URLs")
330 +// return
331 +// }
332 +//
333 +// // check if link can be opened with google maps.
334 +// guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
335 +// UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
336 +// return
337 +// }
338 +//
339 +// UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
340 +
341 + guard let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
342 + print("Error creating URLs")
343 + return
344 + }
345 +
346 + UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
347 +
348 + }
349 +
350 + private func loadMapPins() {
351 + for item in merchantsArray {
352 + let pin = MerchantAnnotation(item)
353 + mapView.addAnnotation(pin)
354 +
355 +// self.annotationGroup.append(pin)
356 +// self.mapView.addAnnotations(self.annotationGroup)
357 +// self.mapView.showAnnotations(self.annotationGroup, animated: true)
358 +
359 +// let annotation = MKPointAnnotation()
360 +// annotation.coordinate.longitude = item._longitude
361 +// annotation.coordinate.latitude = item._latitude
362 +// annotation.title = item._admin_name //This is the line to remove the optional annotation.title? from.
363 +// annotation.subtitle = item._admin_name
364 +// self.annotationGroup.append(annotation)
365 +// self.mapView.addAnnotations(self.annotationGroup)
366 +// self.mapView.showAnnotations(self.annotationGroup, animated: true)
367 +
368 +// let annotation = MKPointAnnotation()
369 +// let centerCoordinate = CLLocationCoordinate2D(latitude: item._latitude, longitude: item._longitude)
370 +// annotation.coordinate = centerCoordinate
371 +// annotation.title = "Pass Title here"
372 +// mapView.addAnnotation(annotation)
373 + }
374 +// mapView.showAnnotations(mapView.annotations, animated: true)
375 + }
376 +
377 + private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
378 + self.selectedMerchant = annotation.model
379 +
380 + if let parent = self.parentMerchantsArray.first(where: {($0._uuid == self.selectedMerchant?._parent)}) {
381 + self.parentMerchant = parent
382 + }
383 +
384 +// self.titleView.text = self.selectedMerchant?._admin_name
385 + self.titleView.text = self.parentMerchant?._admin_name
386 +
387 + if (self.isMarket == true) {
388 + self.nameImageView.load(link: self.parentMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
389 + } else {
390 + self.nameImageView.load(link: self.selectedMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
391 + }
392 +
393 + self.nameView.text = self.selectedMerchant?._name
394 + // TODO: Make dynamic
395 + self.hoursView.text = ""
396 + self.phoneView.text = self.selectedMerchant?._telephone
397 + self.addressView.text = self.selectedMerchant?._address
398 + }
399 +
400 + private func showPinDetailsView() {
401 + self.infoTopConstraint.constant = -320
402 + UIView.animate(withDuration: 1.0) {
403 + self.view.layoutIfNeeded()
404 + }
405 + }
406 +
407 + private func hidePinDetailsView() {
408 + self.selectedMerchant = nil
409 +
410 + self.infoTopConstraint.constant = 0
411 + UIView.animate(withDuration: 1.0) {
412 + self.view.layoutIfNeeded()
413 + }
414 + }
415 +
416 + // map view delegate
417 +// public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
418 +//
419 +//// guard !(annotation is MKUserLocation) else {
420 +//// return nil
421 +//// }
422 +//
423 +// var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
424 +// if (annotationView == nil) {
425 +// print("=== annotationView == nil ===")
426 +//
427 +// annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
428 +// annotationView?.canShowCallout = false
429 +// } else {
430 +// print("=== annotationView != nil ===")
431 +//
432 +// annotationView?.annotation = annotation
433 +// }
434 +//
435 +// // TODO: add custom pin image?
436 +// //annotationView?.image = UIImage(named: "custom")
437 +//
438 +// print("=== returned annotation ===")
439 +// print(annotation)
440 +//
441 +// return annotationView
442 +// }
443 +
444 + // map view delegate
445 + public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
446 +
447 +// guard !(annotation is MKUserLocation) else {
448 +// return nil
449 +// }
450 +
451 + var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
452 + if (annotationView == nil) {
453 + annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
454 + annotationView?.canShowCallout = false
455 +
456 + } else {
457 + annotationView?.annotation = annotation
458 + }
459 +
460 + // Add custom pin image
461 + annotationView?.frame = CGRect(x: 0, y: 0, width: 45, height: 60)
462 +
463 + let pinImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 45, height: 60))
464 + pinImageView.contentMode = .scaleAspectFit
465 +
466 + if let pinImg = UIImage(named: "map_pin", in: MyEmptyClass.resourceBundle(), compatibleWith: nil) {
467 + pinImageView.image = pinImg
468 + }
469 +
470 + let logoImageView = UIImageView(frame: CGRect(x: 5, y: 5, width: 35, height: 35))
471 + logoImageView.contentMode = .scaleAspectFit
472 +
473 + let merchant = annotation as? MerchantAnnotation
474 + if let merchantModel = merchant?.model {
475 +
476 + let currentMerchant = merchantModel
477 +
478 + if (self.isMarket == true) {
479 + if let parent = self.parentMerchantsArray.first(where: {($0._uuid == currentMerchant._parent)}) {
480 + let currentMerchantParent = parent
481 +
482 + logoImageView.load(link: currentMerchantParent._img_preview , placeholder: UIImage(), cache: URLCache())
483 +
484 + pinImageView.addSubview(logoImageView)
485 + annotationView?.addSubview(pinImageView)
486 +
487 + return annotationView
488 + } else {
489 + return nil
490 + }
491 +
492 + } else {
493 + logoImageView.load(link: currentMerchant._img_preview , placeholder: UIImage(), cache: URLCache())
494 +
495 + pinImageView.addSubview(logoImageView)
496 + annotationView?.addSubview(pinImageView)
497 +
498 + return annotationView
499 + }
500 +
501 + } else {
502 + return nil
503 + }
504 + }
505 +
506 + public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
507 + let merchant = view.annotation as? MerchantAnnotation
508 + let merchantModel = merchant!.model
509 +// logTrackersEvent("click", ("ShopsScreenMarker:" + (merchantModel._uuid)))
510 +
511 + loadPinDetailsView(merchant!)
512 + showPinDetailsView()
513 + }
514 +
515 + public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
516 + hidePinDetailsView()
517 + }
518 +}
519 +
520 +private extension MKMapView {
521 +
522 + func centerToLocation(_ location: CLLocation, regionRadius: CLLocationDistance = 1000) {
523 + let coordinateRegion = MKCoordinateRegion(
524 + center: location.coordinate,
525 + latitudinalMeters: regionRadius,
526 + longitudinalMeters: regionRadius)
527 + setRegion(coordinateRegion, animated: true)
528 + }
529 +}
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<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">
3 + <device id="retina6_12" orientation="portrait" appearance="light"/>
4 + <dependencies>
5 + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24504"/>
6 + <capability name="Safe area layout guides" minToolsVersion="9.0"/>
7 + <capability name="System colors in document resources" minToolsVersion="11.0"/>
8 + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9 + </dependencies>
10 + <objects>
11 + <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapViewController" customModule="SwiftWarplyFramework" customModuleProvider="target">
12 + <connections>
13 + <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
14 + </connections>
15 + </placeholder>
16 + <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
17 + <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
18 + <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
19 + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
20 + <subviews>
21 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="hCU-aG-ygY" userLabel="Main View">
22 + <rect key="frame" x="0.0" y="118" width="393" height="734"/>
23 + <subviews>
24 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="9Ss-50-8lb">
25 + <rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
26 + </imageView>
27 + <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="YL5-4p-PKK">
28 + <rect key="frame" x="0.0" y="0.0" width="393" height="734"/>
29 + </mapView>
30 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="wO4-b0-Lbj">
31 + <rect key="frame" x="0.0" y="420" width="414" height="11.5"/>
32 + </imageView>
33 + </subviews>
34 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
35 + <constraints>
36 + <constraint firstItem="wO4-b0-Lbj" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="7Sp-xV-6LO"/>
37 + <constraint firstAttribute="bottom" secondItem="YL5-4p-PKK" secondAttribute="bottom" id="AXy-Mh-nYV"/>
38 + <constraint firstItem="wO4-b0-Lbj" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="Gfx-j2-M85"/>
39 + <constraint firstAttribute="bottom" secondItem="9Ss-50-8lb" secondAttribute="bottom" id="Ou1-x0-kmw"/>
40 + <constraint firstAttribute="trailing" secondItem="9Ss-50-8lb" secondAttribute="trailing" id="WVl-E8-L8A"/>
41 + <constraint firstItem="YL5-4p-PKK" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="Zit-4v-Yuu"/>
42 + <constraint firstItem="9Ss-50-8lb" firstAttribute="leading" secondItem="hCU-aG-ygY" secondAttribute="leading" id="miC-Sr-KkR"/>
43 + <constraint firstAttribute="trailing" secondItem="YL5-4p-PKK" secondAttribute="trailing" id="nif-Bx-zgh"/>
44 + <constraint firstItem="YL5-4p-PKK" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="pyA-tM-UhQ"/>
45 + <constraint firstItem="9Ss-50-8lb" firstAttribute="top" secondItem="hCU-aG-ygY" secondAttribute="top" id="qVD-4w-XZ6"/>
46 + <constraint firstAttribute="trailing" secondItem="wO4-b0-Lbj" secondAttribute="trailing" id="urK-JF-3MF"/>
47 + </constraints>
48 + <variation key="default">
49 + <mask key="subviews">
50 + <exclude reference="9Ss-50-8lb"/>
51 + <exclude reference="wO4-b0-Lbj"/>
52 + </mask>
53 + </variation>
54 + </view>
55 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PAK-cJ-dw4">
56 + <rect key="frame" x="0.0" y="532" width="383" 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="1JT-2j-Bcy" userLabel="Title">
59 + <rect key="frame" x="30" y="20" width="273" height="30"/>
60 + <constraints>
61 + <constraint firstAttribute="height" constant="30" id="5TE-up-pRD"/>
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="aQV-3K-z4j" userLabel="Close">
68 + <rect key="frame" x="323" y="15" width="40" height="40"/>
69 + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70 + <constraints>
71 + <constraint firstAttribute="height" constant="40" id="AUj-eK-kSi"/>
72 + <constraint firstAttribute="width" constant="40" id="uQ2-Oz-rWC"/>
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_3">
76 + <color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
77 + </state>
78 + </button>
79 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ttk-zQ-KM4" userLabel="LineTop">
80 + <rect key="frame" x="10" y="6" width="363" height="1"/>
81 + <constraints>
82 + <constraint firstAttribute="height" constant="1" id="8D8-Xt-Lbv"/>
83 + </constraints>
84 + </view>
85 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="B7q-yf-o88" userLabel="NameLogo">
86 + <rect key="frame" x="30" y="32" width="30" height="30"/>
87 + <constraints>
88 + <constraint firstAttribute="width" constant="30" id="7nf-hY-Ezk"/>
89 + <constraint firstAttribute="height" constant="30" id="sjS-02-Eub"/>
90 + </constraints>
91 + </imageView>
92 + <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">
93 + <rect key="frame" x="70" y="26.333333333333371" width="283" height="21.666666666666671"/>
94 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
95 + <nil key="textColor"/>
96 + <nil key="highlightedColor"/>
97 + </label>
98 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="eMM-ae-vGC" userLabel="LineMiddle">
99 + <rect key="frame" x="10" y="87" width="363" height="1"/>
100 + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
101 + <constraints>
102 + <constraint firstAttribute="height" constant="1" id="3CO-Ko-Rxt"/>
103 + </constraints>
104 + </view>
105 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="WN7-4d-O1d" userLabel="phoneIcon">
106 + <rect key="frame" x="30" y="118" width="20" height="20"/>
107 + <constraints>
108 + <constraint firstAttribute="width" constant="20" id="Lpw-Ge-h4I"/>
109 + <constraint firstAttribute="height" constant="20" id="zim-Kg-KKG"/>
110 + </constraints>
111 + </imageView>
112 + <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">
113 + <rect key="frame" x="60" y="108" width="293" height="40"/>
114 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
115 + <nil key="textColor"/>
116 + <nil key="highlightedColor"/>
117 + </label>
118 + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fWk-DO-FiO" userLabel="LineBottom">
119 + <rect key="frame" x="10" y="168" width="363" height="1"/>
120 + <color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
121 + <constraints>
122 + <constraint firstAttribute="height" constant="1" id="NeA-5u-IqP"/>
123 + </constraints>
124 + </view>
125 + <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Xew-2M-gI6" userLabel="AddressIcon">
126 + <rect key="frame" x="30" y="200.66666666666663" width="20" height="20"/>
127 + <constraints>
128 + <constraint firstAttribute="width" constant="20" id="HNo-mc-jiJ"/>
129 + <constraint firstAttribute="height" constant="20" id="MO8-KX-QOl"/>
130 + </constraints>
131 + </imageView>
132 + <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">
133 + <rect key="frame" x="60.000000000000014" y="189" width="210.33333333333337" height="43"/>
134 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
135 + <nil key="textColor"/>
136 + <nil key="highlightedColor"/>
137 + </label>
138 + <button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qDd-Yd-pTP" userLabel="Directions">
139 + <rect key="frame" x="309" y="193.66666666666663" width="54" height="34"/>
140 + <constraints>
141 + <constraint firstAttribute="height" constant="34" id="LpN-v7-Yp6"/>
142 + </constraints>
143 + <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
144 + <state key="normal" title="Button"/>
145 + </button>
146 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wd5-lH-XLv" userLabel="HoursLabel">
147 + <rect key="frame" x="70" y="46.333333333333371" width="283" height="21.666666666666671"/>
148 + <fontDescription key="fontDescription" type="system" pointSize="18"/>
149 + <color key="textColor" systemColor="systemGray2Color"/>
150 + <nil key="highlightedColor"/>
151 + </label>
152 + </subviews>
153 + <viewLayoutGuide key="safeArea" id="A8T-mq-RUc"/>
154 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
155 + <constraints>
156 + <constraint firstItem="A8T-mq-RUc" firstAttribute="bottom" secondItem="j0g-29-RGB" secondAttribute="bottom" constant="20" id="47W-TC-Iq6"/>
157 + <constraint firstItem="j0g-29-RGB" firstAttribute="top" secondItem="fWk-DO-FiO" secondAttribute="bottom" constant="20" id="6At-pO-qxn"/>
158 + <constraint firstAttribute="trailing" secondItem="ttk-zQ-KM4" secondAttribute="trailing" constant="10" id="6Yz-PW-jBT"/>
159 + <constraint firstItem="Wd5-lH-XLv" firstAttribute="leading" secondItem="B7q-yf-o88" secondAttribute="trailing" constant="10" id="99N-6y-XYD"/>
160 + <constraint firstAttribute="height" constant="320" id="9Qa-uY-9oN"/>
161 + <constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="Wd5-lH-XLv" secondAttribute="trailing" constant="30" id="EVS-vi-TZw"/>
162 + <constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="wX9-ST-8UI" secondAttribute="trailing" constant="30" id="G5V-tS-T1m"/>
163 + <constraint firstItem="aQV-3K-z4j" firstAttribute="centerY" secondItem="1JT-2j-Bcy" secondAttribute="centerY" id="Gw5-PM-T9X"/>
164 + <constraint firstItem="WN7-4d-O1d" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="30" id="Hgy-Bh-wq2"/>
165 + <constraint firstAttribute="trailing" secondItem="aQV-3K-z4j" secondAttribute="trailing" constant="20" id="JC7-MR-KYu"/>
166 + <constraint firstAttribute="trailing" secondItem="eMM-ae-vGC" secondAttribute="trailing" constant="10" id="R6c-03-SFe"/>
167 + <constraint firstAttribute="trailing" secondItem="qDd-Yd-pTP" secondAttribute="trailing" constant="20" id="Rvz-pu-eQS"/>
168 + <constraint firstItem="wX9-ST-8UI" firstAttribute="centerY" secondItem="B7q-yf-o88" secondAttribute="centerY" constant="-10" id="TaR-Lf-ecG"/>
169 + <constraint firstItem="1JT-2j-Bcy" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="30" id="Un6-Bn-5Cx"/>
170 + <constraint firstItem="aQV-3K-z4j" firstAttribute="leading" secondItem="1JT-2j-Bcy" secondAttribute="trailing" constant="20" id="VTK-Ig-jcY"/>
171 + <constraint firstItem="eMM-ae-vGC" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="10" id="Xls-Sc-nMR"/>
172 + <constraint firstItem="fWk-DO-FiO" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="10" id="Yaq-Wm-Sh1"/>
173 + <constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="fWk-DO-FiO" secondAttribute="trailing" constant="10" id="Zf9-Hq-LZ8"/>
174 + <constraint firstItem="WN7-4d-O1d" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="30" id="as8-NK-hDO"/>
175 + <constraint firstItem="Xew-2M-gI6" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="30" id="c0U-1m-JLn"/>
176 + <constraint firstItem="wX9-ST-8UI" firstAttribute="leading" secondItem="B7q-yf-o88" secondAttribute="trailing" constant="10" id="cIZ-6l-6Ol"/>
177 + <constraint firstItem="fWk-DO-FiO" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="80" id="cnB-9w-nVf"/>
178 + <constraint firstItem="B7q-yf-o88" firstAttribute="top" secondItem="ttk-zQ-KM4" secondAttribute="bottom" constant="25" id="crk-rS-ZoA"/>
179 + <constraint firstItem="qDd-Yd-pTP" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="j0g-29-RGB" secondAttribute="trailing" constant="10" id="d0S-Hk-REY"/>
180 + <constraint firstItem="fWk-DO-FiO" firstAttribute="top" secondItem="BeV-ne-dq3" secondAttribute="bottom" constant="20" id="flV-RP-wgV"/>
181 + <constraint firstItem="eMM-ae-vGC" firstAttribute="top" secondItem="B7q-yf-o88" secondAttribute="bottom" constant="25" id="hcA-zV-gd7"/>
182 + <constraint firstItem="ttk-zQ-KM4" firstAttribute="leading" secondItem="PAK-cJ-dw4" secondAttribute="leading" constant="10" id="ie0-ev-rxM"/>
183 + <constraint firstItem="1JT-2j-Bcy" firstAttribute="top" secondItem="PAK-cJ-dw4" secondAttribute="top" constant="20" id="nFl-w9-iVo"/>
184 + <constraint firstItem="BeV-ne-dq3" firstAttribute="top" secondItem="eMM-ae-vGC" secondAttribute="bottom" constant="20" id="pAF-w8-eMj"/>
185 + <constraint firstItem="BeV-ne-dq3" firstAttribute="leading" secondItem="WN7-4d-O1d" secondAttribute="trailing" constant="10" id="qPP-Zp-wrA"/>
186 + <constraint firstItem="Wd5-lH-XLv" firstAttribute="centerY" secondItem="B7q-yf-o88" secondAttribute="centerY" constant="10" id="sqY-g0-XMg"/>
187 + <constraint firstItem="j0g-29-RGB" firstAttribute="leading" secondItem="Xew-2M-gI6" secondAttribute="trailing" constant="10" id="t8V-Kc-8HZ"/>
188 + <constraint firstItem="A8T-mq-RUc" firstAttribute="trailing" secondItem="BeV-ne-dq3" secondAttribute="trailing" constant="30" id="wsg-Mj-539"/>
189 + <constraint firstItem="eMM-ae-vGC" firstAttribute="top" secondItem="ttk-zQ-KM4" secondAttribute="bottom" constant="80" id="y7y-DL-xvl"/>
190 + <constraint firstItem="qDd-Yd-pTP" firstAttribute="centerY" secondItem="j0g-29-RGB" secondAttribute="centerY" id="yw7-yu-Zsa"/>
191 + <constraint firstItem="B7q-yf-o88" firstAttribute="leading" secondItem="A8T-mq-RUc" secondAttribute="leading" constant="30" id="zcl-DE-MxY"/>
192 + <constraint firstItem="qDd-Yd-pTP" firstAttribute="centerY" secondItem="Xew-2M-gI6" secondAttribute="centerY" id="zeL-xW-rr8"/>
193 + </constraints>
194 + </view>
195 + </subviews>
196 + <viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
197 + <color key="backgroundColor" systemColor="systemBackgroundColor"/>
198 + <constraints>
199 + <constraint firstItem="hCU-aG-ygY" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="GKy-gM-hNB"/>
200 + <constraint firstAttribute="trailing" secondItem="PAK-cJ-dw4" secondAttribute="trailing" constant="10" id="GNw-9D-9VJ"/>
201 + <constraint firstAttribute="bottom" secondItem="hCU-aG-ygY" secondAttribute="bottom" id="GSk-ie-S3S"/>
202 + <constraint firstAttribute="trailing" secondItem="hCU-aG-ygY" secondAttribute="trailing" id="J99-rM-YFP"/>
203 + <constraint firstAttribute="bottom" secondItem="PAK-cJ-dw4" secondAttribute="bottom" id="Rbp-ec-95P"/>
204 + <constraint firstItem="PAK-cJ-dw4" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="RpT-Pg-Mld"/>
205 + <constraint firstItem="hCU-aG-ygY" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="Tgj-nb-Tww"/>
206 + </constraints>
207 + <point key="canvasLocation" x="65" y="154"/>
208 + </view>
209 + </objects>
210 + <resources>
211 + <image name="coupons_scrollview_white" width="214" height="462"/>
212 + <image name="ic_address" width="12.5" height="17"/>
213 + <image name="ic_close_3" width="11.333333015441895" height="11.666666984558105"/>
214 + <image name="ic_phone" width="15.5" height="15.5"/>
215 + <systemColor name="systemBackgroundColor">
216 + <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
217 + </systemColor>
218 + <systemColor name="systemGray2Color">
219 + <color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
220 + </systemColor>
221 + </resources>
222 +</document>
1 +//
2 +// MerchantAnnotation.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Manos Chorianopoulos on 17/3/26.
6 +//
7 +
8 +import Foundation
9 +import MapKit
10 +
11 +@objc public class MerchantAnnotation: NSObject, MKAnnotation {
12 + let model: MerchantModel
13 + public let coordinate: CLLocationCoordinate2D
14 +
15 +
16 + init(_ model: MerchantModel) {
17 + self.model = model
18 + self.coordinate = CLLocationCoordinate2D(latitude: model._latitude, longitude: model._longitude)
19 + super.init()
20 + }
21 +}