Manos Chorianopoulos

Added MapsViewController

Showing 19 changed files with 645 additions and 1 deletions
......@@ -24,6 +24,10 @@
1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */; };
1EBE97212865EE460080EFF7 /* MFYInboxTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */; };
1EBF5F072840E13F00B8B17F /* SwiftEventBus in Frameworks */ = {isa = PBXBuildFile; productRef = 1EBF5F062840E13F00B8B17F /* SwiftEventBus */; };
1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */; };
1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */; };
1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */; };
1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */; };
7630AD9A6242D60846D6750C /* Pods_SwiftWarplyFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D5F56DD4E5371A50AD2D87 /* Pods_SwiftWarplyFramework.framework */; };
A02F34052882B6E60086465F /* TelcoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02F34042882B6E60086465F /* TelcoViewController.swift */; };
A04D31DE288FF670000E43B5 /* HistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A04D31DD288FF670000E43B5 /* HistoryViewController.swift */; };
......@@ -179,6 +183,10 @@
1EB5F4C728536FD60016F36E /* StepsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StepsViewController.swift; sourceTree = "<group>"; };
1EB5F4C9285370C90016F36E /* LoyaltyAnalysisViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoyaltyAnalysisViewController.swift; sourceTree = "<group>"; };
1EBE97202865EE460080EFF7 /* MFYInboxTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MFYInboxTableViewCell.swift; sourceTree = "<group>"; };
1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSMButton.swift; sourceTree = "<group>"; };
1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; };
1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; };
1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
A02F34042882B6E60086465F /* TelcoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TelcoViewController.swift; sourceTree = "<group>"; };
A04D31DD288FF670000E43B5 /* HistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HistoryViewController.swift; sourceTree = "<group>"; };
A079366D2885D07700064122 /* AnalysisChildViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisChildViewController.swift; sourceTree = "<group>"; };
......@@ -430,6 +438,7 @@
E6A77850282933340045BBA8 /* SwiftWarplyFramework */ = {
isa = PBXGroup;
children = (
1ECA079028D9E3BA00D2BDE0 /* CSMButton.swift */,
1E108A9728A3FA9B0008B8E7 /* Info.plist */,
1E108A8B28A3F8FF0008B8E7 /* Resources */,
A02F34042882B6E60086465F /* TelcoViewController.swift */,
......@@ -465,6 +474,9 @@
E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */,
E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */,
E6A77A37282BC3530045BBA8 /* Media.xcassets */,
1ECA079228D9E53F00D2BDE0 /* MapsViewController.swift */,
1ECA079628D9E66200D2BDE0 /* MerchantAnnotation.swift */,
1ECA079328D9E53F00D2BDE0 /* MapsViewController.xib */,
);
path = SwiftWarplyFramework;
sourceTree = "<group>";
......@@ -814,6 +826,7 @@
E6A778E5282933E60045BBA8 /* Main.storyboard in Resources */,
1E108A9628A3F9280008B8E7 /* pf_square_sans_pro_bold.ttf in Resources */,
1E108A9228A3F9280008B8E7 /* pf_square_sans_pro_regular.ttf in Resources */,
1ECA079528D9E53F00D2BDE0 /* MapsViewController.xib in Resources */,
E6A778EA282933E60045BBA8 /* WLNativeVideoTableViewCell.xib in Resources */,
1E108A9528A3F9280008B8E7 /* pf_square_sans_pro_bold_italic.ttf in Resources */,
E6A7790A282933E60045BBA8 /* warp_white_close_button.png in Resources */,
......@@ -901,8 +914,10 @@
E6A77917282933E60045BBA8 /* UIViewController+WLAdditions.m in Sources */,
1EA2BB792865BFE8003F2AB0 /* InboxTableViewCell.swift in Sources */,
E6A77943282933E70045BBA8 /* AFNetworkReachabilityManager.m in Sources */,
1ECA079428D9E53F00D2BDE0 /* MapsViewController.swift in Sources */,
A07936702885D95600064122 /* AnalysisItemViewCell.swift in Sources */,
E6A77956282933E70045BBA8 /* GiftsViewController.swift in Sources */,
1ECA079728D9E66200D2BDE0 /* MerchantAnnotation.swift in Sources */,
E6A778F1282933E60045BBA8 /* WLNativeAdTableViewCell.m in Sources */,
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */,
E6A77938282933E70045BBA8 /* AFImageDownloader.m in Sources */,
......@@ -924,6 +939,7 @@
1EB5F4CA285370C90016F36E /* LoyaltyAnalysisViewController.swift in Sources */,
E6A7794A282933E70045BBA8 /* FMDatabaseAdditions.m in Sources */,
E6A77903282933E60045BBA8 /* WLAPSItem.m in Sources */,
1ECA079128D9E3BA00D2BDE0 /* CSMButton.swift in Sources */,
E6A7790B282933E60045BBA8 /* WLPushManager.m in Sources */,
A079366E2885D07700064122 /* AnalysisChildViewController.swift in Sources */,
E6A77950282933E70045BBA8 /* FMResultSet.m in Sources */,
......
//
// CSMButton.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 20/9/22.
//
import UIKit
// @IBDesignable
@objc public class CSMButton: UIButton {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
configure()
}
override init(frame: CGRect = .zero) {
super.init(frame: frame)
configure()
}
public override func prepareForInterfaceBuilder() {
super.prepareForInterfaceBuilder()
configure()
}
}
private extension CSMButton {
func configure() {
setImage(UIImage(named: "directions"), for: .normal)
titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
setTitleColor(.white, for: .normal)
backgroundColor = UIColor(rgb: 0x79BF14)
layer.cornerRadius = 12.0
imageEdgeInsets = UIEdgeInsets(top:0.0, left:0.0, bottom:0.0, right:5.0);
titleEdgeInsets = UIEdgeInsets(top:0.0, left:5.0, bottom:0.0, right:0.0);
}
}
......@@ -252,6 +252,8 @@ import AVFoundation
}
@IBAction func mapButtonAction(_ sender: Any) {
// TODO: open MapVC
let vc = SwiftWarplyFramework.MapsViewController(nibName: "MapsViewController", bundle: Bundle(for: MyEmptyClass.self))
vc.couponSet = coupon?.couponset_data
self.navigationController?.pushViewController(vc, animated: true)
}
}
......
//
// MapsViewController.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 20/9/22.
//
import UIKit
import MapKit
@objc public class MapsViewController: UIViewController, MKMapViewDelegate {
// ui
@IBOutlet weak var backgroundImage: UIImageView!
@IBOutlet private var mapView: MKMapView!
@IBOutlet weak var closeButton: UIButton!
@IBOutlet private var titleView: UILabel!
@IBOutlet private var nameImageView: UIImageView!
@IBOutlet private var nameView: UILabel!
@IBOutlet private var hoursView: UILabel!
@IBOutlet private var phoneView: UILabel!
@IBOutlet private var addressView: UILabel!
@IBOutlet private var directionsButton: CSMButton!
@IBOutlet private var infoTopConstraint: NSLayoutConstraint!
// public
public var couponSet: swiftApi.CouponSetItemModel?
var merchantsArray:Array<swiftApi.MerchantModel> = []
var selectedMerchant: swiftApi.MerchantModel?
var annotationGroup = [MKPointAnnotation]()
//
var loading: Bool = false
let initialLocation = CLLocation(latitude: 37.9641262, longitude: 23.7468592) // greece
//
public override func viewDidLoad() {
super.viewDidLoad()
self.hidesBottomBarWhenPushed = true
self.infoTopConstraint.constant = 0
setBackButton()
setNavigationTitle("Καταστήματα")
backgroundImage.image = UIImage(named: "coupons_scrollview_white")
mapView.delegate = self
mapView.centerToLocation(initialLocation, regionRadius: 1000000)
mapView.clipsToBounds = true
mapView.layer.cornerRadius = 30
mapView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
closeButton.imageView?.layer.transform = CATransform3DMakeScale(1.5, 1.5, 1.5)
titleView.font = UIFont(name: "PFSquareSansPro-Bold", size: 19)
titleView.textColor = UIColor(rgb: 0x757575)
nameView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
nameView.textColor = UIColor(rgb: 0x415564)
hoursView.font = UIFont(name: "PFSquareSansPro-Regular", size: 18)
hoursView.textColor = UIColor(rgb: 0xAEAEAE)
hoursView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
hoursView.textColor = UIColor(rgb: 0x415564)
addressView.font = UIFont(name: "PFSquareSansPro-Medium", size: 18)
addressView.textColor = UIColor(rgb: 0x415564)
//directionsButton.titleLabel?.font = UIFont(name: "PFSquareSansPro-Medium", size: 16)
directionsButton.setTitle("Οδηγίες", for: .normal)
directionsButton.setImage(UIImage(named: "ic_directions"), for: .normal)
// directionsButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 5);
// directionsButton.titleEdgeInsets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 0);
// directionsButton.sizeToFit()
//directionsButton.setTitleColor(.white, for: .normal)
//directionsButton.backgroundColor = UIColor(red: 0.47, green: 0.75, blue: 0.08, alpha: 1.00)
//directionsButton.layer.cornerRadius = 12.0
load()
}
// mvp
@objc func load() {
if (loading) {
return;
}
showLoading()
if (couponSet != nil) {
if let merchantUuid: String = couponSet?.merchant_uuid {
swiftApi().getMultilingualMerchantsAsync([], false, 0.0, [], "", 0, [merchantUuid], getMerchantsCallback)
showContent()
}
}
}
func getMerchantsCallback (_ merchantsData: Array<swiftApi.MerchantModel>?) -> Void {
if (merchantsData != nil) {
DispatchQueue.main.async {
self.merchantsArray = merchantsData ?? []
self.loadMapPins()
}
return
}
}
private func showLoading() {
loading = true
}
private func showError() {
}
private func showContent() {
loading = false
}
// private
@IBAction func closeButtonAction(_ sender: Any) {
print("closeButton Pressed!!!")
hidePinDetailsView()
let selectedAnnotations = mapView.selectedAnnotations
for annotation in selectedAnnotations {
mapView.deselectAnnotation(annotation, animated: false)
}
}
@IBAction func directionsButtomAction(_ sender: Any) {
guard let lon = selectedMerchant?._longitude, let lat = selectedMerchant?._latitude else {
return
}
// guard your URL instances
// guard let googleMapsUrl = URL(string: String(format: "https://www.google.com/maps/@%.6f,%.6f,6z", lat, lon)),
// let appleMapsUrl = URL(string: String(format: "http://maps.apple.com/?ll=%.6f,%.6f", lat, lon)) else {
// print("Error creating URLs")
// return
// }
guard let googleMapsUrl = URL(string: "https://www.google.co.in/maps/dir/?saddr=&daddr=\(lat),\(lon)&directionsmode=driving"),
let appleMapsUrl = URL(string: "http://maps.apple.com/?daddr=\(lat),\(lon)") else {
print("Error creating URLs")
return
}
// check if link can be opened with google maps.
guard UIApplication.shared.canOpenURL(googleMapsUrl) else {
UIApplication.shared.open(appleMapsUrl, options: [:], completionHandler: nil)
return
}
UIApplication.shared.open(googleMapsUrl, options: [:], completionHandler: nil)
}
private func loadMapPins() {
for item in merchantsArray {
let pin = MerchantAnnotation(item)
mapView.addAnnotation(pin)
// self.annotationGroup.append(pin)
// self.mapView.addAnnotations(self.annotationGroup)
// self.mapView.showAnnotations(self.annotationGroup, animated: true)
// let annotation = MKPointAnnotation()
// annotation.coordinate.longitude = item._longitude
// annotation.coordinate.latitude = item._latitude
// annotation.title = item._admin_name //This is the line to remove the optional annotation.title? from.
// annotation.subtitle = item._admin_name
// self.annotationGroup.append(annotation)
// self.mapView.addAnnotations(self.annotationGroup)
// self.mapView.showAnnotations(self.annotationGroup, animated: true)
// let annotation = MKPointAnnotation()
// let centerCoordinate = CLLocationCoordinate2D(latitude: item._latitude, longitude: item._longitude)
// annotation.coordinate = centerCoordinate
// annotation.title = "Pass Title here"
// mapView.addAnnotation(annotation)
}
// mapView.showAnnotations(mapView.annotations, animated: true)
}
private func loadPinDetailsView(_ annotation: MerchantAnnotation) {
self.selectedMerchant = annotation.model
self.titleView.text = self.selectedMerchant?._admin_name
self.nameImageView.load(link: self.selectedMerchant?._img_preview ?? "", placeholder: UIImage(), cache: URLCache())
self.nameView.text = self.selectedMerchant?._name
// TODO: Make dynamic
self.hoursView.text = ""
self.phoneView.text = self.selectedMerchant?._telephone
self.addressView.text = self.selectedMerchant?._address
}
private func showPinDetailsView() {
self.infoTopConstraint.constant = -320
UIView.animate(withDuration: 1.0) {
self.view.layoutIfNeeded()
}
}
private func hidePinDetailsView() {
self.selectedMerchant = nil
self.infoTopConstraint.constant = 0
UIView.animate(withDuration: 1.0) {
self.view.layoutIfNeeded()
}
}
// map view delegate
// public func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
//
//// guard !(annotation is MKUserLocation) else {
//// return nil
//// }
//
// var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "warply_custom")
// if (annotationView == nil) {
// print("=== annotationView == nil ===")
//
// annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: "warply_custom")
// annotationView?.canShowCallout = false
// } else {
// print("=== annotationView != nil ===")
//
// annotationView?.annotation = annotation
// }
//
// // TODO: add custom pin image?
// //annotationView?.image = UIImage(named: "custom")
//
// print("=== returned annotation ===")
// print(annotation)
//
// return annotationView
// }
public func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
let merchant = view.annotation as? MerchantAnnotation
loadPinDetailsView(merchant!)
showPinDetailsView()
}
public func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
hidePinDetailsView()
}
}
private extension MKMapView {
func centerToLocation(_ location: CLLocation, regionRadius: CLLocationDistance = 1000) {
let coordinateRegion = MKCoordinateRegion(
center: location.coordinate,
latitudinalMeters: regionRadius,
longitudinalMeters: regionRadius)
setRegion(coordinateRegion, animated: true)
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MapsViewController" customModule="swift_example" customModuleProvider="target">
<connections>
<outlet property="addressView" destination="syP-Hv-OGD" id="LUw-pI-3va"/>
<outlet property="backgroundImage" destination="tVJ-fk-ani" id="ETq-VL-6q7"/>
<outlet property="closeButton" destination="lEb-V2-2FC" id="aEd-fS-pbO"/>
<outlet property="directionsButton" destination="bw3-J9-wHr" id="sSi-OK-KTA"/>
<outlet property="hoursView" destination="u9U-A7-lbO" id="xm5-gQ-zjh"/>
<outlet property="infoTopConstraint" destination="9av-UX-8VL" id="uKX-lw-OTH"/>
<outlet property="mapView" destination="F1c-ck-cQa" id="cdx-31-BiL"/>
<outlet property="nameImageView" destination="eDV-A1-pOO" id="JYq-eT-kEG"/>
<outlet property="nameView" destination="MsK-eg-pkk" id="60t-lm-O8m"/>
<outlet property="phoneView" destination="knh-D9-CuM" id="ES2-6e-vRx"/>
<outlet property="titleView" destination="oVh-dv-f7a" id="dst-Ku-EFw"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rKl-bF-Zpf" userLabel="Main View">
<rect key="frame" x="0.0" y="44" width="414" height="852"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coupons_scrollview_white" translatesAutoresizingMaskIntoConstraints="NO" id="tVJ-fk-ani">
<rect key="frame" x="0.0" y="0.0" width="414" height="852"/>
</imageView>
<mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="F1c-ck-cQa">
<rect key="frame" x="0.0" y="2" width="414" height="850"/>
</mapView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="tVJ-fk-ani" secondAttribute="bottom" id="5cR-5W-AwC"/>
<constraint firstItem="tVJ-fk-ani" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" id="EMb-Ay-M18"/>
<constraint firstAttribute="trailing" secondItem="tVJ-fk-ani" secondAttribute="trailing" id="LLM-SY-Ejo"/>
<constraint firstItem="F1c-ck-cQa" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="P7b-Km-FIn"/>
<constraint firstItem="F1c-ck-cQa" firstAttribute="top" secondItem="rKl-bF-Zpf" secondAttribute="top" constant="2" id="X2Z-Vc-V9u"/>
<constraint firstAttribute="trailing" secondItem="F1c-ck-cQa" secondAttribute="trailing" id="dcT-Pn-T5v"/>
<constraint firstItem="tVJ-fk-ani" firstAttribute="leading" secondItem="rKl-bF-Zpf" secondAttribute="leading" id="eVM-4A-gJc"/>
<constraint firstAttribute="bottom" secondItem="F1c-ck-cQa" secondAttribute="bottom" id="ipi-oy-9jV"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zc1-ew-qcl">
<rect key="frame" x="0.0" y="576" width="414" height="320"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="INTERSPORT" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oVh-dv-f7a" userLabel="Title">
<rect key="frame" x="30" y="20" width="294" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Gf2-VN-pNV"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lEb-V2-2FC" userLabel="Close">
<rect key="frame" x="344" y="20" width="40" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="gnd-qn-qo5"/>
<constraint firstAttribute="height" constant="40" id="oeu-zs-b1J"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="B" image="ic_close">
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="closeButtonAction:" destination="-1" eventType="touchUpInside" id="bIB-NN-rUr"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="F55-qj-PDc" userLabel="LineTop">
<rect key="frame" x="10" y="52" width="394" height="1"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="18a-J3-UZm"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="eDV-A1-pOO" userLabel="NameLogo">
<rect key="frame" x="30" y="78" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="IjG-Iw-fIq"/>
<constraint firstAttribute="height" constant="30" id="LnS-gV-hIi"/>
</constraints>
</imageView>
<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">
<rect key="frame" x="70" y="72.5" width="314" height="21.5"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SHs-vI-jD7" userLabel="LineMiddle">
<rect key="frame" x="10" y="133" width="394" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="hMo-qH-T2k"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_phone" translatesAutoresizingMaskIntoConstraints="NO" id="KhY-nt-uwH" userLabel="phoneIcon">
<rect key="frame" x="30" y="164" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="1rt-pN-Dld"/>
<constraint firstAttribute="width" constant="20" id="3Rd-ir-r7Q"/>
</constraints>
</imageView>
<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">
<rect key="frame" x="60" y="154" width="324" height="40"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sAf-f8-8jc" userLabel="LineBottom">
<rect key="frame" x="10" y="214" width="394" height="1"/>
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="vSP-6I-Lz6"/>
</constraints>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_address" translatesAutoresizingMaskIntoConstraints="NO" id="Bic-c4-J9E" userLabel="AddressIcon">
<rect key="frame" x="30" y="240.5" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="A8o-MY-I6f"/>
<constraint firstAttribute="width" constant="20" id="Xma-bp-6IZ"/>
</constraints>
</imageView>
<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">
<rect key="frame" x="60" y="235" width="247" height="31"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="18"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bw3-J9-wHr" userLabel="Directions" customClass="CSMButton" customModule="swift_example" customModuleProvider="target">
<rect key="frame" x="317" y="235" width="67" height="31"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Button"/>
<connections>
<action selector="directionsButtomAction:" destination="-1" eventType="touchUpInside" id="nMR-Jk-Wm4"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Δευτέρα - Τετάρτη" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u9U-A7-lbO" userLabel="HoursLabel">
<rect key="frame" x="70" y="92.5" width="314" height="21.5"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<color key="textColor" systemColor="systemGray2Color"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<viewLayoutGuide key="safeArea" id="XS2-AR-3j9"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="u9U-A7-lbO" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="0Z2-uE-kRe"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="MsK-eg-pkk" secondAttribute="trailing" constant="30" id="1qW-i8-MRk"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="bw3-J9-wHr" secondAttribute="bottom" constant="20" id="3vm-pn-qpa"/>
<constraint firstItem="lEb-V2-2FC" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="5bY-RU-ons"/>
<constraint firstItem="knh-D9-CuM" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="20" id="61g-5C-XbI"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="10" id="7W6-cn-WdZ"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="centerY" secondItem="Bic-c4-J9E" secondAttribute="centerY" id="AHw-0D-gur"/>
<constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="eDV-A1-pOO" secondAttribute="bottom" constant="25" id="D8j-Qh-CHB"/>
<constraint firstItem="KhY-nt-uwH" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="Dok-gZ-xf1"/>
<constraint firstItem="SHs-vI-jD7" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="Lj8-XN-HTj"/>
<constraint firstAttribute="trailing" secondItem="F55-qj-PDc" secondAttribute="trailing" constant="10" id="MCj-ek-cnb"/>
<constraint firstAttribute="trailing" secondItem="lEb-V2-2FC" secondAttribute="trailing" constant="30" id="NcX-rr-7OU"/>
<constraint firstItem="syP-Hv-OGD" firstAttribute="leading" secondItem="Bic-c4-J9E" secondAttribute="trailing" constant="10" id="Rl4-cn-VTG"/>
<constraint firstAttribute="trailing" secondItem="SHs-vI-jD7" secondAttribute="trailing" constant="10" id="Smw-Bv-Qlr"/>
<constraint firstItem="lEb-V2-2FC" firstAttribute="leading" secondItem="oVh-dv-f7a" secondAttribute="trailing" constant="20" id="ULP-b9-ToV"/>
<constraint firstItem="MsK-eg-pkk" firstAttribute="leading" secondItem="eDV-A1-pOO" secondAttribute="trailing" constant="10" id="Vg7-xl-oA2"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="YhG-Th-URU"/>
<constraint firstItem="oVh-dv-f7a" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="Zd1-SB-SlA"/>
<constraint firstItem="KhY-nt-uwH" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="30" id="a6s-J0-5rJ"/>
<constraint firstItem="knh-D9-CuM" firstAttribute="leading" secondItem="KhY-nt-uwH" secondAttribute="trailing" constant="10" id="aeR-MK-4WB"/>
<constraint firstItem="eDV-A1-pOO" firstAttribute="leading" secondItem="XS2-AR-3j9" secondAttribute="leading" constant="30" id="bkK-59-wXK"/>
<constraint firstAttribute="height" constant="320" id="eIo-xG-BnE"/>
<constraint firstItem="u9U-A7-lbO" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="10" id="gFw-90-gXL"/>
<constraint firstItem="oVh-dv-f7a" firstAttribute="top" secondItem="Zc1-ew-qcl" secondAttribute="top" constant="20" id="gIA-8o-Pv8"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="u9U-A7-lbO" secondAttribute="trailing" constant="30" id="hZz-zi-NzM"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="sAf-f8-8jc" secondAttribute="trailing" constant="10" id="hn5-U5-rvW"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="SHs-vI-jD7" secondAttribute="bottom" constant="80" id="htI-gJ-mSm"/>
<constraint firstAttribute="trailing" secondItem="bw3-J9-wHr" secondAttribute="trailing" constant="30" id="hya-Ns-ldi"/>
<constraint firstItem="Bic-c4-J9E" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="30" id="iUf-BZ-0kl"/>
<constraint firstItem="F55-qj-PDc" firstAttribute="leading" secondItem="Zc1-ew-qcl" secondAttribute="leading" constant="10" id="jK6-2e-p3v"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="bottom" secondItem="syP-Hv-OGD" secondAttribute="bottom" constant="20" id="luv-Gm-76K"/>
<constraint firstItem="sAf-f8-8jc" firstAttribute="top" secondItem="knh-D9-CuM" secondAttribute="bottom" constant="20" id="m6I-QE-hbq"/>
<constraint firstItem="eDV-A1-pOO" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="25" id="nAA-6u-CUo"/>
<constraint firstItem="XS2-AR-3j9" firstAttribute="trailing" secondItem="knh-D9-CuM" secondAttribute="trailing" constant="30" id="pFB-4b-xx9"/>
<constraint firstItem="MsK-eg-pkk" firstAttribute="centerY" secondItem="eDV-A1-pOO" secondAttribute="centerY" constant="-10" id="wpA-Xv-RdU"/>
<constraint firstItem="syP-Hv-OGD" firstAttribute="top" secondItem="sAf-f8-8jc" secondAttribute="bottom" constant="20" id="xD6-zI-9Nl"/>
<constraint firstItem="SHs-vI-jD7" firstAttribute="top" secondItem="F55-qj-PDc" secondAttribute="bottom" constant="80" id="xPl-UV-cMd"/>
<constraint firstItem="bw3-J9-wHr" firstAttribute="leading" secondItem="syP-Hv-OGD" secondAttribute="trailing" constant="10" id="zAU-89-R2t"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="Zc1-ew-qcl" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="0dW-tS-Vxe"/>
<constraint firstItem="Zc1-ew-qcl" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="bottom" constant="-320" id="9av-UX-8VL"/>
<constraint firstItem="Zc1-ew-qcl" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="LKw-N3-e8B"/>
<constraint firstItem="rKl-bF-Zpf" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="W3y-NU-vli"/>
<constraint firstItem="rKl-bF-Zpf" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="cMl-Pz-ulj"/>
<constraint firstAttribute="bottom" secondItem="rKl-bF-Zpf" secondAttribute="bottom" id="pOF-9Z-ipf"/>
<constraint firstAttribute="trailing" secondItem="rKl-bF-Zpf" secondAttribute="trailing" id="xaW-C2-dLe"/>
</constraints>
<point key="canvasLocation" x="137.68115942028987" y="120.53571428571428"/>
</view>
</objects>
<resources>
<image name="coupons_scrollview_white" width="214" height="462"/>
<image name="ic_address" width="12.5" height="17"/>
<image name="ic_close" width="17" height="17.5"/>
<image name="ic_phone" width="15.5" height="15.5"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemGray2Color">
<color red="0.68235294117647061" green="0.68235294117647061" blue="0.69803921568627447" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
{
"images" : [
{
"filename" : "ic_pin_location.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_pin_location-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_pin_location-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_pin_compass.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_pin_compass-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_pin_compass-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "ic_pin_tel.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "ic_pin_tel-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "ic_pin_tel-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// MerchantAnnotation.swift
// SwiftWarplyFramework
//
// Created by Manos Chorianopoulos on 20/9/22.
//
import Foundation
import MapKit
@objc public class MerchantAnnotation: NSObject, MKAnnotation {
let model: swiftApi.MerchantModel
public let coordinate: CLLocationCoordinate2D
init(_ model: swiftApi.MerchantModel) {
self.model = model
self.coordinate = CLLocationCoordinate2D(latitude: model._latitude, longitude: model._longitude)
super.init()
}
}