AHDirectionsObject is an NSObject class designed to make opening other maps applications a breeze. This class is developed for our newest iOS App [All Hours]( Abouthttps://itunes.apple.com/gb/app/all-hours/id1000983835?mt=8), please be sure to check it out!
Supports
Add the AHDirectionsObject.h & AHDirectionsObject.m files to your project. In your .h file add Setup
#import "AHDirectionsObject.h"
In your .m file add
AHDirectionsObject *directions = [[AHDirectionsObject alloc] init];
To return a list (NSArray) of the available (installed) map services on the users device simple call... Installed Applications
[directions directionsApplications];
To open a specifyed application call the Open Application
directionsHandle
. This method has two parameters - the location (CLLocation
) and the type of application (NSString
)[directions directionsHandle:[[CLLocation alloc] initWithLatitude:YOUR_LATITUDE_FLOAT longitude:YOUR_LONGITUDE_FLOAT] type:@"citymapper"];
They type key accepts...
Or, set as nil
to open the native Apple Maps.
If a application Notes
type
is passed which is not available the class will revert to Apple Maps