Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Dimitris Togias
2022-09-14 07:08:41 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f94819bf24a676c3dd3cad3098429dd3863d1e07
f94819bf
1 parent
763a76ce
add custom annotation class and add direction handler
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
5 deletions
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/project.pbxproj
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.xib
SwiftWarplyFramework/SwiftWarplyFramework/MerchantAnnotation.swift
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/project.pbxproj
View file @
f94819b
...
...
@@ -35,6 +35,7 @@
A079367E2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */; };
A080CFD628D170A20045A315 /* MapsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD428D170A20045A315 /* MapsViewController.swift */; };
A080CFD728D170A20045A315 /* MapsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A080CFD528D170A20045A315 /* MapsViewController.xib */; };
A080CFDA28D1889A0045A315 /* MerchantAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */; };
A09DBCAE2888BA8100DD50B0 /* SharingHistoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */; };
E6A77853282933340045BBA8 /* SwiftWarplyFramework.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6A77852282933340045BBA8 /* SwiftWarplyFramework.docc */; };
E6A77854282933340045BBA8 /* SwiftWarplyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = E6A77851282933340045BBA8 /* SwiftWarplyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
...
...
@@ -191,6 +192,7 @@
A079367D2885F60A00064122 /* AnalysisHeaderMessageViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalysisHeaderMessageViewCell.swift; sourceTree = "<group>"; };
A080CFD428D170A20045A315 /* MapsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapsViewController.swift; sourceTree = "<group>"; };
A080CFD528D170A20045A315 /* MapsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MapsViewController.xib; sourceTree = "<group>"; };
A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantAnnotation.swift; sourceTree = "<group>"; };
A09DBCAD2888BA8100DD50B0 /* SharingHistoryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingHistoryViewController.swift; sourceTree = "<group>"; };
A9B7BE01A4E812DE49866EF8 /* Pods-SwiftWarplyFramework.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.debug.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.debug.xcconfig"; sourceTree = "<group>"; };
B9EB8A451EF0C5AD75094EEE /* Pods-SwiftWarplyFramework.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwiftWarplyFramework.release.xcconfig"; path = "Target Support Files/Pods-SwiftWarplyFramework/Pods-SwiftWarplyFramework.release.xcconfig"; sourceTree = "<group>"; };
...
...
@@ -382,6 +384,7 @@
isa = PBXGroup;
children = (
A07936722885E67400064122 /* AnalysisItem.swift */,
A080CFD928D1889A0045A315 /* MerchantAnnotation.swift */,
);
name = models;
sourceTree = "<group>";
...
...
@@ -885,6 +888,7 @@
1E74838D28378AF40042A589 /* CouponBarcodeViewController.swift in Sources */,
E6A778F0282933E60045BBA8 /* WLNativeAdsCollectionMode.m in Sources */,
E6A7791C282933E60045BBA8 /* WLSMSActionHandlerDeprecated.m in Sources */,
A080CFDA28D1889A0045A315 /* MerchantAnnotation.swift in Sources */,
E6A77934282933E70045BBA8 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
E6A77A34282BB3BB0045BBA8 /* ActiveGiftsViewController.swift in Sources */,
E6A778E6282933E60045BBA8 /* MyEmptyClass.swift in Sources */,
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
f94819b
...
...
@@ -2,7 +2,7 @@
// MapsViewController.swift
// SwiftWarplyFramework
//
// Created by Βασιλης Σκουρας on 1
4
/9/22.
// Created by Βασιλης Σκουρας on 1
0
/9/22.
//
import
UIKit
...
...
@@ -110,15 +110,18 @@ class MapsViewController: UIViewController, MKMapViewDelegate {
hidePinDetailsView
()
}
@IBAction
func
directionsButtomAction
(
_
sender
:
Any
)
{
}
private
func
loadMapPins
()
{
for
item
in
merchantsArray
{
let
pin
=
MKPointAnnotation
()
pin
.
coordinate
=
CLLocationCoordinate2D
(
latitude
:
item
.
_latitude
,
longitude
:
item
.
_longitude
)
let
pin
=
MerchantAnnotation
(
item
)
mapView
.
addAnnotation
(
pin
)
}
}
private
func
loadPinDetailsView
()
{
private
func
loadPinDetailsView
(
_
annotation
:
MerchantAnnotation
)
{
self
.
titleView
.
text
=
"INTERSPORT"
self
.
nameImageView
.
image
=
UIImage
(
named
:
"intersport"
)
self
.
nameView
.
text
=
"Intersport Χαλάνδρι"
...
...
@@ -162,7 +165,8 @@ class MapsViewController: UIViewController, MKMapViewDelegate {
}
func
mapView
(
_
mapView
:
MKMapView
,
didSelect
view
:
MKAnnotationView
)
{
loadPinDetailsView
()
let
merchant
=
view
.
annotation
as?
MerchantAnnotation
loadPinDetailsView
(
merchant
!
)
showPinDetailsView
()
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.xib
View file @
f94819b
...
...
@@ -118,6 +118,9 @@
<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=
"94"
width=
"314"
height=
"18"
/>
...
...
SwiftWarplyFramework/SwiftWarplyFramework/MerchantAnnotation.swift
0 → 100644
View file @
f94819b
//
// MerchantAnnotation.swift
// SwiftWarplyFramework
//
// Created by Βασιλης Σκουρας on 11/9/22.
//
import
Foundation
import
MapKit
class
MerchantAnnotation
:
NSObject
,
MKAnnotation
{
let
model
:
swiftApi
.
MerchantModel
let
coordinate
:
CLLocationCoordinate2D
init
(
_
model
:
swiftApi
.
MerchantModel
)
{
self
.
model
=
model
self
.
coordinate
=
CLLocationCoordinate2D
(
latitude
:
model
.
_latitude
,
longitude
:
model
.
_longitude
)
super
.
init
()
}
}
Please
register
or
login
to post a comment