效果图:
工程图:
在代码中要加入第三方库MapDraw.
代码:
#import "AppDelegate.h" //加入头文件 #import "DrawMapViewController.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. DrawMapViewController *viewController = [[DrawMapViewController alloc] init]; UINavigationController *rootNavController = [[UINavigationController alloc] initWithRootViewController:viewController]; [self.window addSubview:[rootNavController view]]; [self.window makeKeyAndVisible]; return YES; }