-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEventGeo.swift
More file actions
43 lines (34 loc) · 826 Bytes
/
EventGeo.swift
File metadata and controls
43 lines (34 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// EventGeo.swift
// Where2Help
//
// Created by Aaron Cruz on 4/9/16.
// Copyright © 2016 Where2Help. All rights reserved.
//
import Foundation
class EventGeo: Locatable {
let event: Event!
private(set) var _hasMarker: Bool
// Vienna center
let defaultCoords: Coords = (48.2082, 16.3738)
private(set) var coords: Coords!
init(event: Event) {
self.event = event
_hasMarker = false
setCoords()
}
func hasMarker() -> Bool {
return _hasMarker
}
func toCoords() -> Coords! {
return coords
}
private func setCoords() {
if let lat = event.lat, lng = event.lng {
coords = (lat, lng)
_hasMarker = true
return
}
coords = defaultCoords
}
}