OneBusAway / onebusaway-ios

OneBusAway for iOS, written in Swift.
Other
81 stars 33 forks source link

Start the app with route displayed #617

Open wkulesza opened 1 year ago

wkulesza commented 1 year ago

With an agency that has only one route (and one trip pattern outbound and one inbound) it would make sense to allow the app to start with the route visible on the map straight away, rather than requiring user to have to select stop, choose arrival time and only then see the route and vehicles. Is this possible with current code?

ualch9 commented 1 year ago

In -[AppDelegate applicationReloadRootInterface:], instead of initializing OBAClassicApplicationRootController, you could initialize whatever view controller you want. Create a new "root view controller" that handles the location permissions, loading of data, then present the relevant view controller (TripViewController, StopViewController, etc.).

wkulesza commented 1 year ago

Do we change it in the Apps section (to allow this change to only relate to one white-label app)? I noticed that such change could be done in that location - OBAKit\Mapping\MapViewController.swift but I would be reluctant to make the changes in the main files directly.

aaronbrethorst commented 1 year ago

You'd build a new app with a new AppDelegate class. Like Alan described, instead of initializing OBAClassicApplicationRootController, you'd display StopViewController or maybe TripViewController with that one route displayed.