I'm struggling with my app, which handles bus routes. I get, at a every single bus stop, every future departure of the busses leaving from there, the departure includes direction and time of departure. I want to be able to get all the times a bus leaves in a given direction, I've done it so far by creating a nested dictionary, however, I was wondering if you can do it smarter? This is what I got so far
var dict = [String: [String : [String]]]()
So it would be something like:
var dict = ["Busname": ["Direction" : ["time1", "time2", "time3"]]]()
Is there a smarter way? Or is this the way to go? I want to get a list of times of departures of the given bus with the given direction.