Can I use MapKit to show directions using public transportation?

I'm developing an app that helps you move around the city. I would love to know if I can show directions from two points by public transportation like subway, bus, etc; using MapKit ? and if not, is there a way to do that with other API´s ?. Something like in the Maps app


Thanks, hope you can help me.



Answered by DTS Engineer in 640804022
On the MKDirections.Request object, set the transportType field to transit.
Accepted Answer
On the MKDirections.Request object, set the transportType field to transit.
Thanks!!!! I've now applied that to my app but it does not return any information, it's all blank. Does anyone know how to fix this?
This question and answer from StackOverlow from 4 years ago (!) suggests:

Routing directions for transit is currently not supported (iOS 9). MKDirectionsRequest will return a null error, as you observed. This only seems to be documented directly in MapKit's headers.

I am trying to implement transit directions as well, with the transportType field set to .transit, and getting the same null error.
MKDirections does not return route information for .transit, but the calculateETA method will provide the expected DepartureDate and ArrivalDate for a provided transit departure date or arrival date.

This probably doesn't help in your case, because the user wouldn't necessarily know which bus/train/ferry to use.

Regards, Michaela
Can I use MapKit to show directions using public transportation?
 
 
Q