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
Manos Chorianopoulos
2024-06-19 16:31:28 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fbfa2f4761a256d362092cf597e00b6b4dc0b452
fbfa2f47
1 parent
613bfc19
add custom pins at MapsViewController
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
2 deletions
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/Contents.json
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin 1.png
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin 2.png
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin.png
SwiftWarplyFramework/Pods/Pods.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
fbfa2f4
...
...
@@ -7,7 +7,7 @@
<key>
Pods-SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
0
</integer>
<integer>
1
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcodeproj/xcuserdata/manos.xcuserdatad/xcschemes/xcschememanagement.plist
View file @
fbfa2f4
...
...
@@ -7,7 +7,7 @@
<key>
SwiftWarplyFramework.xcscheme_^#shared#^_
</key>
<dict>
<key>
orderHint
</key>
<integer>
1
</integer>
<integer>
0
</integer>
</dict>
</dict>
</dict>
...
...
SwiftWarplyFramework/SwiftWarplyFramework.xcworkspace/xcuserdata/manos.xcuserdatad/UserInterfaceState.xcuserstate
View file @
fbfa2f4
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/MapsViewController.swift
View file @
fbfa2f4
...
...
@@ -440,6 +440,58 @@ import MapKit
//
// return annotationView
// }
// map view delegate
public
func
mapView
(
_
mapView
:
MKMapView
,
viewFor
annotation
:
MKAnnotation
)
->
MKAnnotationView
?
{
// guard !(annotation is MKUserLocation) else {
// return nil
// }
var
annotationView
=
mapView
.
dequeueReusableAnnotationView
(
withIdentifier
:
"warply_custom"
)
if
(
annotationView
==
nil
)
{
annotationView
=
MKAnnotationView
(
annotation
:
annotation
,
reuseIdentifier
:
"warply_custom"
)
annotationView
?
.
canShowCallout
=
false
}
else
{
annotationView
?
.
annotation
=
annotation
}
// Add custom pin image
annotationView
?
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
45
,
height
:
60
)
let
pinImageView
=
UIImageView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
45
,
height
:
60
))
pinImageView
.
contentMode
=
.
scaleAspectFit
if
let
pinImg
=
UIImage
(
named
:
"map_pin"
,
in
:
MyEmptyClass
.
resourceBundle
(),
compatibleWith
:
nil
)
{
pinImageView
.
image
=
pinImg
}
let
logoImageView
=
UIImageView
(
frame
:
CGRect
(
x
:
5
,
y
:
5
,
width
:
35
,
height
:
35
))
logoImageView
.
contentMode
=
.
scaleAspectFit
let
merchant
=
annotation
as?
MerchantAnnotation
if
let
merchantModel
=
merchant
?
.
model
{
let
currentMerchant
=
merchantModel
if
let
parent
=
self
.
parentMerchantsArray
.
first
(
where
:
{(
$0
.
_uuid
==
currentMerchant
.
_parent
)})
{
let
currentMerchantParent
=
parent
if
(
self
.
isMarket
==
true
)
{
logoImageView
.
load
(
link
:
currentMerchantParent
.
_img_preview
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
}
else
{
logoImageView
.
load
(
link
:
currentMerchant
.
_img_preview
,
placeholder
:
UIImage
(),
cache
:
URLCache
())
}
}
}
pinImageView
.
addSubview
(
logoImageView
)
annotationView
?
.
addSubview
(
pinImageView
)
return
annotationView
}
public
func
mapView
(
_
mapView
:
MKMapView
,
didSelect
view
:
MKAnnotationView
)
{
let
merchant
=
view
.
annotation
as?
MerchantAnnotation
...
...
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/Contents.json
0 → 100644
View file @
fbfa2f4
{
"images"
:
[
{
"filename"
:
"map_pin.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"map_pin 1.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"map_pin 2.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin 1.png
0 → 100644
View file @
fbfa2f4
4.01 KB
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin 2.png
0 → 100644
View file @
fbfa2f4
4.01 KB
SwiftWarplyFramework/SwiftWarplyFramework/Media.xcassets/map_pin.imageset/map_pin.png
0 → 100644
View file @
fbfa2f4
4.01 KB
Please
register
or
login
to post a comment