AppDelegate.m 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * This file is part of the SDWebImage package.
  3. * (c) Olivier Poitrey <rs@dailymotion.com>
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. #import "AppDelegate.h"
  9. #import "MasterViewController.h"
  10. #import <SDWebImage/SDImageCache.h>
  11. @implementation AppDelegate
  12. @synthesize window = _window;
  13. @synthesize navigationController = _navigationController;
  14. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  15. {
  16. //Add a custom read-only cache path
  17. NSString *bundledPath = [[NSBundle mainBundle].resourcePath stringByAppendingPathComponent:@"CustomPathImages"];
  18. [[SDImageCache sharedImageCache] addReadOnlyCachePath:bundledPath];
  19. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  20. // Override point for customization after application launch.
  21. MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil];
  22. self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
  23. self.window.rootViewController = self.navigationController;
  24. [self.window makeKeyAndVisible];
  25. return YES;
  26. }
  27. - (void)applicationWillResignActive:(UIApplication *)application
  28. {
  29. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
  30. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
  31. }
  32. - (void)applicationDidEnterBackground:(UIApplication *)application
  33. {
  34. // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
  35. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
  36. }
  37. - (void)applicationWillEnterForeground:(UIApplication *)application
  38. {
  39. // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
  40. }
  41. - (void)applicationDidBecomeActive:(UIApplication *)application
  42. {
  43. // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
  44. }
  45. - (void)applicationWillTerminate:(UIApplication *)application
  46. {
  47. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
  48. }
  49. @end