Skip to content

Commit

Permalink
Fixed #9: Another of this bugs squashed!
Browse files Browse the repository at this point in the history
  • Loading branch information
David Gatti committed Jun 17, 2015
1 parent dd1eccd commit d2f38f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions GarageOpener/AppSettings.swift
Expand Up @@ -19,7 +19,18 @@ class AppSettings {
var useCount: Int = 0
var lastUser: String = ""
var lastUsed: NSDate = NSDate.distantPast() as! NSDate
var userID: String = ""
var userID: String {
get {
var tmpUserID: String = ""

let defaults = NSUserDefaults.standardUserDefaults()
if let userID = defaults.stringForKey("userID") {
tmpUserID = userID
}

return tmpUserID
}
}

//MARK: Secrets
var ParticleToken: String = ""
Expand All @@ -29,12 +40,6 @@ class AppSettings {

//MARK: Initialization
init() {

let defaults = NSUserDefaults.standardUserDefaults()

if let userID = defaults.stringForKey("userID") {
self.userID = userID
}

// Get the Token and Device ID for Particle
var myDict: NSDictionary?
Expand Down
2 changes: 1 addition & 1 deletion GarageOpener/Info.plist
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit d2f38f4

Please sign in to comment.