-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocationStore.swift
More file actions
28 lines (23 loc) · 862 Bytes
/
LocationStore.swift
File metadata and controls
28 lines (23 loc) · 862 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
//
// LocationStore.swift
// Cluster
//
// Created by Michael Fellows on 3/9/16.
// Copyright © 2016 ImagineME. All rights reserved.
//
import Foundation
class LocationStore : NSObject {
let latitudeKey = "keyCurrentLatitiude"
let longitudeKey = "keyCurrentLongitude"
static let sharedStore = LocationStore()
func updateLocation(latitude: Double!, longitude: Double!) {
NSUserDefaults.standardUserDefaults().setDouble(latitude, forKey: self.latitudeKey)
NSUserDefaults.standardUserDefaults().setDouble(longitude, forKey: self.longitudeKey)
}
func currentLatitude() -> Double {
return NSUserDefaults.standardUserDefaults().doubleForKey(self.latitudeKey)
}
func currentLongitude() -> Double {
return NSUserDefaults.standardUserDefaults().doubleForKey(self.longitudeKey)
}
}