Skip to content

Commit

Permalink
Adds route short name to trip controller's title bar
Browse files Browse the repository at this point in the history
Fixes #329 - Add trip short name to trip view (on map or list view)
  • Loading branch information
aaronbrethorst committed Aug 14, 2021
1 parent 5f46fb3 commit 5c0c113
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OBAKit/Trip/TripViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ class TripViewController: UIViewController,
return
}

let parts = [tripStatus.vehicleID, tripStatus.activeTrip.route.shortName].compactMap { $0 }

if parts.count > 0 {
titleView.topLabel.text = parts.joined(separator: " - ")
}

if let vehicleID = tripStatus.vehicleID {
titleView.topLabel.text = vehicleID
title = vehicleID
}

Expand Down

0 comments on commit 5c0c113

Please sign in to comment.