AppDelegate.m 1.2 KB

12345678910111213141516171819202122
  1. #import "AppDelegate.h"
  2. #import "GeneratedPluginRegistrant.h"
  3. @implementation AppDelegate
  4. - (BOOL)application:(UIApplication *)application
  5. didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  6. [GeneratedPluginRegistrant registerWithRegistry:self];
  7. // Override point for customization after application launch.
  8. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"developer_guide_ios" ofType:@"pdf"];
  9. NSString *documentFolder = [NSHomeDirectory() stringByAppendingFormat:@"/%@/%@", @"Documents",@"Samples"];
  10. if (![[NSFileManager defaultManager] fileExistsAtPath:documentFolder])
  11. [[NSFileManager defaultManager] createDirectoryAtURL:[NSURL fileURLWithPath:documentFolder] withIntermediateDirectories:YES attributes:nil error:nil];
  12. NSString * documentPath = [documentFolder stringByAppendingPathComponent:filePath.lastPathComponent];
  13. if (![[NSFileManager defaultManager] fileExistsAtPath:documentPath])
  14. [[NSFileManager defaultManager] copyItemAtURL:[NSURL fileURLWithPath:filePath] toURL:[NSURL fileURLWithPath:documentPath] error:nil];
  15. return [super application:application didFinishLaunchingWithOptions:launchOptions];
  16. }
  17. @end