Skip to content

Commit 00e726e

Browse files
committed
updated to support WMATAFetcher 2.2.0
1 parent 814ec1f commit 00e726e

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

DC Metro.xcodeproj/project.pbxproj

+6
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
CreatedOnToolsVersion = 7.3;
247247
DevelopmentTeam = 2848SVWH7M;
248248
LastSwiftMigration = 0800;
249+
ProvisioningStyle = Automatic;
249250
SystemCapabilities = {
250251
com.apple.ApplicationGroups.Mac = {
251252
enabled = 1;
@@ -259,6 +260,7 @@
259260
CreatedOnToolsVersion = 7.3;
260261
DevelopmentTeam = 2848SVWH7M;
261262
LastSwiftMigration = 0800;
263+
ProvisioningStyle = Automatic;
262264
SystemCapabilities = {
263265
com.apple.ApplicationGroups.Mac = {
264266
enabled = 1;
@@ -569,6 +571,7 @@
569571
CODE_SIGN_ENTITLEMENTS = "DC Metro.entitlements";
570572
CODE_SIGN_IDENTITY = "Mac Developer";
571573
COMBINE_HIDPI_IMAGES = YES;
574+
DEVELOPMENT_TEAM = 2848SVWH7M;
572575
INFOPLIST_FILE = DCMetro/Info.plist;
573576
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
574577
MACOSX_DEPLOYMENT_TARGET = 10.10;
@@ -587,6 +590,7 @@
587590
CODE_SIGN_ENTITLEMENTS = "DC Metro.entitlements";
588591
CODE_SIGN_IDENTITY = "Mac Developer";
589592
COMBINE_HIDPI_IMAGES = YES;
593+
DEVELOPMENT_TEAM = 2848SVWH7M;
590594
INFOPLIST_FILE = DCMetro/Info.plist;
591595
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
592596
MACOSX_DEPLOYMENT_TARGET = 10.10;
@@ -605,6 +609,7 @@
605609
CODE_SIGN_IDENTITY = "Mac Developer";
606610
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
607611
COMBINE_HIDPI_IMAGES = YES;
612+
DEVELOPMENT_TEAM = 2848SVWH7M;
608613
INFOPLIST_FILE = DCMetroWidget/Info.plist;
609614
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
610615
MACOSX_DEPLOYMENT_TARGET = 10.10;
@@ -625,6 +630,7 @@
625630
CODE_SIGN_IDENTITY = "Mac Developer";
626631
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";
627632
COMBINE_HIDPI_IMAGES = YES;
633+
DEVELOPMENT_TEAM = 2848SVWH7M;
628634
INFOPLIST_FILE = DCMetroWidget/Info.plist;
629635
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
630636
MACOSX_DEPLOYMENT_TARGET = 10.10;

DCMetro/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>7</string>
24+
<string>9</string>
2525
<key>Fabric</key>
2626
<dict>
2727
<key>APIKey</key>

DCMetroWidget/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>XPC!</string>
2323
<key>CFBundleVersion</key>
24-
<string>7</string>
24+
<string>9</string>
2525
<key>Fabric</key>
2626
<dict>
2727
<key>APIKey</key>

DCMetroWidget/MainViewController.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class MainViewController: NSViewController, NCWidgetProviding, NSTableViewDelega
9898
self.selectedStationLabel.stringValue = selectedStation.description
9999

100100
let trainsHeight = self.trains.count * (self.ROW_HEIGHT + self.ROW_SPACING)
101-
let spacesHeight = WMATAfetcher.getSpaceCount(self.trains) * (self.ROW_HEIGHT - self.SPACE_HEIGHT)
101+
let spacesHeight = WMATAfetcher.getSpaceCount(trains: self.trains) * (self.ROW_HEIGHT - self.SPACE_HEIGHT)
102102

103103
self.predictionTableViewHeightConstraint.constant = CGFloat(self.HEADER_HEIGHT + trainsHeight - spacesHeight)
104104
self.predictionTableView.reloadData()
@@ -166,10 +166,10 @@ class MainViewController: NSViewController, NCWidgetProviding, NSTableViewDelega
166166
}
167167

168168
func tableView(_ tableView: NSTableView, heightOfRow row: Int) -> CGFloat {
169-
if self.trains[row].group != "-1" {
170-
return CGFloat(ROW_HEIGHT)
171-
} else {
169+
if self.trains[row].group == "-1" {
172170
return CGFloat(SPACE_HEIGHT)
171+
} else {
172+
return CGFloat(ROW_HEIGHT)
173173
}
174174
}
175175

@@ -180,7 +180,7 @@ class MainViewController: NSViewController, NCWidgetProviding, NSTableViewDelega
180180
LocationManager.sharedManager.stopUpdatingLocation()
181181

182182
if currentLocation != nil {
183-
fiveClosestStations = WMATAfetcher.getClosestStations(currentLocation!, numStations: 5)
183+
fiveClosestStations = WMATAfetcher.getClosestStations(location: currentLocation!, numStations: 5)
184184
if !didSelectStation {
185185
selectedStation = fiveClosestStations[0]
186186
}
@@ -213,7 +213,7 @@ class MainViewController: NSViewController, NCWidgetProviding, NSTableViewDelega
213213
Wrapper method that calls getPrediction(), passing it the selectedStation.
214214
*/
215215
func getPredictionsForSelectedStation() {
216-
WMATAfetcher.getStationPredictions(selectedStation.rawValue, onCompleted: {
216+
WMATAfetcher.getStationPredictions(stationCode: selectedStation.rawValue, onCompleted: {
217217
trainResponse in
218218
if trainResponse.errorCode == nil {
219219
self.trains = trainResponse.trains!

Podfile.lock

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
2-
- Crashlytics (3.8.2):
2+
- Crashlytics (3.8.3):
33
- Fabric (~> 1.6.3)
4-
- Fabric (1.6.9)
5-
- SwiftyJSON (3.1.1)
6-
- WMATAFetcher (2.1.0):
4+
- Fabric (1.6.11)
5+
- SwiftyJSON (3.1.3)
6+
- WMATAFetcher (2.2.0):
77
- SwiftyJSON (~> 3.0)
88

99
DEPENDENCIES:
@@ -12,11 +12,11 @@ DEPENDENCIES:
1212
- WMATAFetcher
1313

1414
SPEC CHECKSUMS:
15-
Crashlytics: 27acca95a01b042a8294291dd6dff27f8f6af6d7
16-
Fabric: bc5bec42cef4bcf1ee3ce0e218fc518e4b44dfbb
17-
SwiftyJSON: f0be2e604f83e8405a624e9f891898bf6ed4e019
18-
WMATAFetcher: dc4a278dfc34d415bfb949e444f0166793a8231f
15+
Crashlytics: 2b6dbe138a42395577cfa73dfa1aa7248cadf39e
16+
Fabric: 5911403591946b8228ab1c51d98f1d7137e863c6
17+
SwiftyJSON: 38a8ea2006779c0fc4c310cb2ee8195327740faf
18+
WMATAFetcher: 782b4d3ae6b967bd1de6dbe113d95ba2cbfb667f
1919

2020
PODFILE CHECKSUM: cf472ee5754ad4f01b24dd56f92f19db35f25794
2121

22-
COCOAPODS: 1.1.0.rc.2
22+
COCOAPODS: 1.2.0.beta.1

0 commit comments

Comments
 (0)