Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.进行iOS系统的适配 #1638

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

liuxiaobai710189615
Copy link

2.FLAnimatedImage替换为最新代码,只做了const BOOL isGIFData = imageSourceContainerType ? UTTypeConformsTo(imageSourceContainerType, kUTTypeGIF) : NO; 判断改动 3.增加TZWindowManager,Window管理类

2.FLAnimatedImage替换为最新代码,只做了const BOOL isGIFData = imageSourceContainerType ? UTTypeConformsTo(imageSourceContainerType, kUTTypeGIF) : NO; 判断改动
3.增加TZWindowManager,Window管理类
…tionStatusForAccessLevel:PHAccessLevelReadWrite] iOS14.0判断
resultImage = [self fixOrientation:resultImage];
if (completion) completion(resultImage,info,NO);
}];
if (@available(iOS 13.0, *)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个建议抽一个公共方法(可以就放TZImageManager里),这个公共方法里判断iOS13,其它地方调用这个公共方法,可以省许多if代码。现在到处if else,回调处理逻辑重复存在,比较杂乱

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经在TZImageManager 抽一个公共方法 requestImageDataFitSystemForAsset

UIWindowScene *curWinSc = (UIWindowScene *)tmpSc;
return curWinSc.keyWindow;
} else {
return [[[UIApplication sharedApplication] windows] objectAtIndex:0];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用第0个window代替keyWindow稳定吗?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经在 TZCommonTools 中currentKeyWindow重新获取keyWindow

[UIApplication sharedApplication].statusBarHidden = NO;
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了兼容iOS9以下系统,要留这么一大段if的话,就不支持iOS9以下了吧...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要测试下,横竖屏切换是否会让状态栏显示哈,测试正常的话回复下哈

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

切换横屏不显示 切换竖屏显示,在iOS13以后

iOS9以下代码删除

isStatusBarHidden = [[TZWindowManager manager] currentWindow].windowScene.statusBarManager.statusBarHidden;
} else {
isStatusBarHidden = [UIApplication sharedApplication].statusBarHidden;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个和对requestImageDataAndOrientationForAsset的调用一样,建议抽成个公共方法,到处去判断太冗余了
可以放到TZCommonTools里

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经在 TZCommonTools 中currentStatusBarHidden 抽成个公共方法

if (CGRectEqualToRect(keyWindow.bounds, [UIScreen mainScreen].bounds)) {
window = keyWindow;
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段取window的逻辑,和[[TZWindowManager manager] currentWindow]不一样,直接替换可能有问题吧?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经在 TZCommonTools 中currentKeyWindow重新获取keyWindow

CGFloat naviBarHeight = statusBarHeight + _tzImagePickerVc.navigationBar.tz_height;
_naviBar.frame = CGRectMake(0, 0, self.view.tz_width, naviBarHeight);
_backButton.frame = CGRectMake(10, 10 + statusBarHeightInterval, 44, 44);
_selectButton.frame = CGRectMake(self.view.tz_width - 56, 10 + statusBarHeightInterval, 44, 44);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把10 + statusBarHeightInterval换成statusBarHeight的考虑是?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

让左右两个 Button 对称

@@ -35,7 +37,7 @@
#define CURRENT_SYSTEM_VERSION [[UIDevice currentDevice] systemVersion]
#define SYSTEM_VERSION_GREATER_THAN_15 ([CURRENT_SYSTEM_VERSION floatValue] >= 15.0)

@class TZAlbumCell, TZAssetCell;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里改成import TZAssetCell是?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umbrella header for module 'TZImagePickerController' does not include header 'TZAssetCell.h'

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeStatusBarOrientationNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
}

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意风格哈,-后面有个空格

  • (void)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants