diff --git a/DC Metro.xcodeproj/project.pbxproj b/DC Metro.xcodeproj/project.pbxproj
index 31b7f03..ee8b907 100644
--- a/DC Metro.xcodeproj/project.pbxproj
+++ b/DC Metro.xcodeproj/project.pbxproj
@@ -239,7 +239,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
- LastUpgradeCheck = 0800;
+ LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "Christopher Rung";
TargetAttributes = {
588D7C461CD1A1CB008A2A22 = {
diff --git a/DCMetro/Info.plist b/DCMetro/Info.plist
index 0a683ed..59051a1 100644
--- a/DCMetro/Info.plist
+++ b/DCMetro/Info.plist
@@ -17,11 +17,11 @@
CFBundlePackageType
APPL
CFBundleShortVersionString
- 2.0.0
+ 2.1.0
CFBundleSignature
????
CFBundleVersion
- 9
+ 11
Fabric
APIKey
diff --git a/DCMetroWidget/Base.lproj/TodayViewController.xib b/DCMetroWidget/Base.lproj/TodayViewController.xib
index a3ccb7e..77be8bb 100644
--- a/DCMetroWidget/Base.lproj/TodayViewController.xib
+++ b/DCMetroWidget/Base.lproj/TodayViewController.xib
@@ -1,7 +1,8 @@
-
+
-
+
+
@@ -296,9 +297,9 @@
-
+
-
+
@@ -386,6 +387,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -395,10 +413,12 @@
+
-
+
+
@@ -414,7 +434,7 @@
-
+
@@ -429,6 +449,7 @@
+
diff --git a/DCMetroWidget/Info.plist b/DCMetroWidget/Info.plist
index d462e41..30d3070 100644
--- a/DCMetroWidget/Info.plist
+++ b/DCMetroWidget/Info.plist
@@ -17,11 +17,11 @@
CFBundlePackageType
XPC!
CFBundleShortVersionString
- 2.0.0
+ 2.1.0
CFBundleSignature
XPC!
CFBundleVersion
- 9
+ 11
Fabric
APIKey
diff --git a/DCMetroWidget/SettingsViewController.swift b/DCMetroWidget/SettingsViewController.swift
index 9700344..713c817 100644
--- a/DCMetroWidget/SettingsViewController.swift
+++ b/DCMetroWidget/SettingsViewController.swift
@@ -27,6 +27,8 @@ class SettingsViewController: NCWidgetListViewController {
@IBOutlet weak var chooseFromListTextField: NSTextField!
@IBOutlet weak var stationPopUpButton: NSPopUpButton!
+ @IBOutlet weak var unitsSegmentedControl: NSSegmentedControl!
+
override var nibName: String? {
return "SettingsViewController"
}
@@ -34,6 +36,7 @@ class SettingsViewController: NCWidgetListViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupPopUpButton()
+ UserDefaults.standard.bool(forKey: "isMetric") ? unitsSegmentedControl.setSelected(true, forSegment: 1) : unitsSegmentedControl.setSelected(true, forSegment: 0)
}
override func viewWillAppear() {
@@ -47,11 +50,7 @@ class SettingsViewController: NCWidgetListViewController {
if currentLocation != nil {
selectStationAndRadioButtonsHeightConstraint.constant = 23
chooseFromListTextField.stringValue = "or choose from the list"
- for (index, radioButton) in stationRadioButtons.enumerated() {
- radioButton.isHidden = false
- let station = fiveClosestStations[index]
- stationRadioButtons[index].title = station.description + String(format: " (%@)", WMATAfetcher.getDistanceFromStation(location: currentLocation!, station: station, isMetric: false))
- }
+ populateStationRadioButtonTitles()
} else {
selectStationAndRadioButtonsHeightConstraint.constant = 2
chooseFromListTextField.stringValue = "Choose a station from the list"
@@ -91,6 +90,11 @@ class SettingsViewController: NCWidgetListViewController {
setSelectedStation(sender.selectedItem?.representedObject as! String)
}
+ @IBAction func touchUnitsSegmentedControl(_ sender: NSSegmentedControl) {
+ unitsSegmentedControl.isSelected(forSegment: 1) ? UserDefaults.standard.set(true, forKey: "isMetric") : UserDefaults.standard.set(false, forKey: "isMetric")
+ populateStationRadioButtonTitles()
+ }
+
func setSelectedStation(_ selectedStationCode: String) {
for radioButton in stationRadioButtons {
radioButton.state = NSOffState
@@ -102,4 +106,13 @@ class SettingsViewController: NCWidgetListViewController {
didSelectStation = true
}
+ func populateStationRadioButtonTitles() {
+ for (index, radioButton) in stationRadioButtons.enumerated() {
+ radioButton.isHidden = false
+ let station = fiveClosestStations[index]
+ let distance = WMATAfetcher.getDistanceFromStation(location: currentLocation!, station: station, isMetric: unitsSegmentedControl.isSelected(forSegment: 1))
+ stationRadioButtons[index].title = station.description + String(format: " (%@)", distance)
+ }
+ }
+
}
diff --git a/Podfile.lock b/Podfile.lock
index a472b14..e3eb0a2 100644
--- a/Podfile.lock
+++ b/Podfile.lock
@@ -3,7 +3,7 @@ PODS:
- Fabric (~> 1.6.3)
- Fabric (1.6.11)
- SwiftyJSON (3.1.3)
- - WMATAFetcher (2.2.1):
+ - WMATAFetcher (2.2.2):
- SwiftyJSON (~> 3.0)
DEPENDENCIES:
@@ -15,7 +15,7 @@ SPEC CHECKSUMS:
Crashlytics: 2b6dbe138a42395577cfa73dfa1aa7248cadf39e
Fabric: 5911403591946b8228ab1c51d98f1d7137e863c6
SwiftyJSON: 38a8ea2006779c0fc4c310cb2ee8195327740faf
- WMATAFetcher: 8353ca1c1244ce7819ffa1a51fdab671d750a7a6
+ WMATAFetcher: f5ac6d87976045b7625244c6018dd5afd4d7cbfe
PODFILE CHECKSUM: cf472ee5754ad4f01b24dd56f92f19db35f25794
diff --git a/Screenshots/App Store/Main.png b/Screenshots/App Store/Main.png
index 1df4842..ea19e35 100644
Binary files a/Screenshots/App Store/Main.png and b/Screenshots/App Store/Main.png differ
diff --git a/Screenshots/App Store/Settings.png b/Screenshots/App Store/Settings.png
index 8d9c1f2..b23b1a2 100644
Binary files a/Screenshots/App Store/Settings.png and b/Screenshots/App Store/Settings.png differ
diff --git a/Screenshots/GitHub/Settings.png b/Screenshots/GitHub/Settings.png
index df59730..00f092e 100644
Binary files a/Screenshots/GitHub/Settings.png and b/Screenshots/GitHub/Settings.png differ