SDWebImage/Examples/SDWebImage OSX Demo/AppDelegate.m

46 lines
1.6 KiB
Mathematica
Raw Normal View History

2016-06-13 14:14:02 +08:00
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2016-06-13 05:09:55 +08:00
#import "AppDelegate.h"
#import <SDWebImage/SDWebImage.h>
#import <SDWebImageWebPCoder/SDWebImageWebPCoder.h>
2016-06-13 05:09:55 +08:00
@interface AppDelegate ()
@end
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
if (@available(iOS 14, tvOS 14, macOS 11, watchOS 7, *)) {
// iOS 14 supports WebP built-in
[[SDImageCodersManager sharedManager] addCoder:[SDImageAWebPCoder sharedCoder]];
} else {
// iOS 13 does not supports WebP, use third-party codec
[[SDImageCodersManager sharedManager] addCoder:[SDImageWebPCoder sharedCoder]];
}
if (@available(iOS 13, tvOS 13, macOS 10.15, watchOS 6, *)) {
// For HEIC animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now.
[[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]];
}
NSStoryboard *mainStoryboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
NSWindowController *initialController = [mainStoryboard instantiateControllerWithIdentifier:@"MainWindowController"];
self.windowController = initialController;
[initialController showWindow:self];
[initialController.window makeKeyAndOrderFront:self];
2016-06-13 05:09:55 +08:00
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {
// Insert code here to tear down your application
}
@end