Skip to content

Commit

Permalink
Adds func to log accuracy enums as string. Refs #37.
Browse files Browse the repository at this point in the history
  • Loading branch information
gradha committed Jun 6, 2015
1 parent d56673f commit e4bd377
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/EHGPS.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ import UIKit
removeObserver(watcher, forKeyPath: EHGPS.KEY_PATH)
}

/** Converts an accuracy enum to a loggable string.
*/
func toString(accuracy: Accuracy) -> String
{
switch(accuracy) {
case .High: return "High"
case .Medium: return "Medium"
case .Low: return "Low"
}
}

/** Changes the desired accuracy of the GPS readings.
* If the GPS is on, it will be reset just in case. Provide a reason
* for the change or nil if you don't want to log the change.
Expand All @@ -177,7 +188,7 @@ import UIKit
}

mAccuracy = accuracy
let message = "Setting accuracy to \(accuracy)";
let message = "Setting accuracy to \(toString(accuracy)).";

switch accuracy {
case .High:
Expand Down

0 comments on commit e4bd377

Please sign in to comment.