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:53:08 +08:00
|
|
|
|
|
|
|
#import "ExtensionDelegate.h"
|
|
|
|
|
2020-07-03 12:48:50 +08:00
|
|
|
#import <SDWebImage/SDWebImage.h>
|
|
|
|
#import <SDWebImageWebPCoder/SDWebImageWebPCoder.h>
|
|
|
|
|
2016-06-13 05:53:08 +08:00
|
|
|
@implementation ExtensionDelegate
|
|
|
|
|
|
|
|
- (void)applicationDidFinishLaunching {
|
|
|
|
// Perform any final initialization of your application.
|
2020-07-03 12:48:50 +08:00
|
|
|
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]];
|
|
|
|
}
|
|
|
|
[[SDImageCodersManager sharedManager] addCoder:[SDImageHEICCoder sharedCoder]]; // For HEIC static/animated image. Animated image is new introduced in iOS 13, but it contains performance issue for now.
|
2016-06-13 05:53:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)applicationDidBecomeActive {
|
|
|
|
// 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.
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)applicationWillResignActive {
|
|
|
|
// 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.
|
|
|
|
// Use this method to pause ongoing tasks, disable timers, etc.
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|