Skip to content

Commit

Permalink
处理在iOS14上YYAnimatedImageView加载不出图片的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
tm-frankd committed Nov 3, 2020
1 parent 42ba209 commit a48e88d
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 15 deletions.
15 changes: 12 additions & 3 deletions Demo/YYImageDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,12 @@
D91A60241F057230008CD5D3 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = ibireme;
TargetAttributes = {
D91A602B1F057230008CD5D3 = {
CreatedOnToolsVersion = 9.0;
ProvisioningStyle = Manual;
};
};
};
Expand Down Expand Up @@ -418,7 +419,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -467,7 +468,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
STRIP_PNG_TEXT = NO;
Expand All @@ -479,11 +480,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = KJ7B9R8CS3;
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../Vendor\"";
INFOPLIST_FILE = YYImageDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ibireme.YYImageDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Dev-Wildcard";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -492,11 +497,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = KJ7B9R8CS3;
FRAMEWORK_SEARCH_PATHS = "\"$(SRCROOT)/../Vendor\"";
INFOPLIST_FILE = YYImageDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ibireme.YYImageDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "Dev-Wildcard";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
3 changes: 2 additions & 1 deletion Framework/YYImage.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
D9A995161F0564180062698B /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = ibireme;
TargetAttributes = {
D9A9951E1F0564180062698B = {
Expand All @@ -176,6 +176,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = D9A995151F0564180062698B;
productRefGroup = D9A995201F0564180062698B /* Products */;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.8">
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -26,12 +26,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -52,8 +49,6 @@
ReferencedContainer = "container:YYImage.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
6 changes: 5 additions & 1 deletion YYImage/YYAnimatedImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ - (void)step:(CADisplayLink *)link {
- (void)displayLayer:(CALayer *)layer {
if (_curFrame) {
layer.contents = (__bridge id)_curFrame.CGImage;
} else {
if (@available(iOS 14.0, *)) {
[super displayLayer:layer];
}
}
}

Expand Down Expand Up @@ -577,7 +581,7 @@ - (void)setCurrentAnimatedImageIndex:(NSUInteger)currentAnimatedImageIndex {
if (currentAnimatedImageIndex >= _curAnimatedImage.animatedImageFrameCount) return;
if (_curIndex == currentAnimatedImageIndex) return;

void (^block)() = ^{
void (^block)(void) = ^{
LOCK(
[_requestQueue cancelAllOperations];
[_buffer removeAllObjects];
Expand Down
6 changes: 3 additions & 3 deletions YYImage/YYImageCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ CG_EXTERN NSString *_Nullable YYImageTypeGetExtension(YYImageType type);


/// Returns the shared DeviceRGB color space.
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceRGB();
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceRGB(void);

/// Returns the shared DeviceGray color space.
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceGray();
CG_EXTERN CGColorSpaceRef YYCGColorSpaceGetDeviceGray(void);

/// Returns whether a color space is DeviceRGB.
CG_EXTERN BOOL YYCGColorSpaceIsDeviceRGB(CGColorSpaceRef space);
Expand Down Expand Up @@ -446,7 +446,7 @@ CG_EXTERN CFDataRef _Nullable YYCGImageCreateEncodedData(CGImageRef imageRef, YY
/**
Whether WebP is available in YYImage.
*/
CG_EXTERN BOOL YYImageWebPAvailable();
CG_EXTERN BOOL YYImageWebPAvailable(void);

/**
Get a webp image frame count;
Expand Down

0 comments on commit a48e88d

Please sign in to comment.