Skip to content

Commit 7eb28d1

Browse files
authored
Merge pull request #233 from cuappdev/omar/travel-time-bug
Fixed bug with travel time wasn't showing properly
2 parents 47195bc + 23ef6f0 commit 7eb28d1

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

TCAT/Cells/RouteTableViewCell.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,6 @@ class RouteTableViewCell: UITableViewCell {
223223
// MARK: Get Data
224224

225225
private func getDepartureAndArrivalTimes(fromRoute route: Route) -> (departureTime: Date, arrivalTime: Date) {
226-
if let firstDepartDirection = route.getFirstDepartRawDirection(), let lastDepartDirection = route.getLastDepartRawDirection() {
227-
return (departureTime: firstDepartDirection.startTime, arrivalTime: lastDepartDirection.endTime)
228-
}
229-
230226
return (departureTime: route.departureTime, arrivalTime: route.arrivalTime)
231227
}
232228

TCAT/Model/Route.swift

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,6 @@ class Route: NSObject, Codable {
221221
return rawDirections.first { $0.type == .depart }
222222
}
223223

224-
func getLastDepartRawDirection() -> Direction? {
225-
return rawDirections.reversed().first { $0.type == .depart }
226-
}
227-
228-
func getRawNumOfWalkLines() -> Int {
229-
var count = 0
230-
for (index, direction) in rawDirections.enumerated() {
231-
if index != rawDirections.count - 1 && direction.type == .walk {
232-
count += 1
233-
}
234-
}
235-
236-
return count
237-
}
238-
239224
/** Calculate travel distance from location passed in to first route summary object and updates travel distance of route
240225
*/
241226
func calculateTravelDistance(fromRawDirections rawDirections: [Direction]) {
@@ -261,22 +246,6 @@ class Route: NSObject, Codable {
261246

262247
}
263248

264-
override var debugDescription: String {
265-
266-
let mainDescription = """
267-
departtureTime: \(self.departureTime)\n
268-
arrivalTime: \(self.arrivalTime)\n
269-
startCoords: \(self.startCoords)\n
270-
endCoords: \(self.endCoords)\n
271-
startName: \(self.startName)\n
272-
endName: \(self.endName)\n
273-
timeUntilDeparture: \(self.timeUntilDeparture)\n
274-
"""
275-
276-
return mainDescription
277-
278-
}
279-
280249
/** Used for sharing. Return a one sentence summary of the route, based on
281250
the first depart or walking direction. Returns "" if no directions.
282251
*/

TCAT/Utilities/Extensions+App.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,19 +241,6 @@ public func ???<T> (optional: T?, defaultValue: @autoclosure () -> String) -> St
241241
}
242242
}
243243

244-
func sortFilteredBusStops(busStops: [Place], letter: Character) -> [Place] {
245-
var nonLetterArray = [Place]()
246-
var letterArray = [Place]()
247-
for stop in busStops {
248-
if stop.name.first! == letter {
249-
letterArray.append(stop)
250-
} else {
251-
nonLetterArray.append(stop)
252-
}
253-
}
254-
return letterArray + nonLetterArray
255-
}
256-
257244
extension Collection {
258245
subscript(optional i: Index) -> Iterator.Element? {
259246
return self.indices.contains(i) ? self[i] : nil

0 commit comments

Comments
 (0)