AppDelegate.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <SDWebImage/SDWebImage.h>
  10. #import <SDWebImageWebPCoder/SDWebImageWebPCoder.h>
  11. @interface AppDelegate ()
  12. @end
  13. @implementation AppDelegate
  14. - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
  15. // Insert code here to initialize your application
  16. if (@available(iOS 14, tvOS 14, macOS 11, watchOS 7, *)) {
  17. // iOS 14 supports WebP built-in
  18. [[SDImageCodersManager sharedManager] addCoder:[SDImageAWebPCoder sharedCoder]];
  19. } else {
  20. // iOS 13 does not supports WebP, use third-party codec
  21. [[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
  22. }
  23. if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) {
  24. // For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now.
  25. [[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]];
  26. }
  27. NSStoryboard *mainStoryboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
  28. NSWindowController *initialController = [mainStoryboard instantiateControllerWithIdentifier:@"MainWindowController"];
  29. self.windowController = initialController;
  30. [initialController showWindow:self];
  31. [initialController.window makeKeyAndOrderFront:self];
  32. }
  33. - (void)applicationWillTerminate:(NSNotification *)aNotification {
  34. // Insert code here to tear down your application
  35. }
  36. @end