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

iOS18beta初始化无法正常选择图库照片,直接进入相簿选择界面。 #1686

Closed
Merlini93 opened this issue Jun 25, 2024 · 2 comments

Comments

@Merlini93
Copy link

Merlini93 commented Jun 25, 2024

提bug前必看
请先回答下列三个问题,否则不允处理,谢谢配合。
1、我最新的Demo是否有这个bug?【如果Demo没问题,请升级新版
答:有

2、你用的是什么版本?升级到最新版后是否正常?
答:3.4.3

3、是否有改动过我库内部的代码?【如有,请说明改动点
答:没有

bug内容描述
iOS 18beta中初始化无法显示最近拍摄的照片,只能选择相册。

我如何复现这个bug?
运行demo即可

截图
image

其它说明
有没有其它要补充的?比如你的初始化TZImagePickerController的代码

@Merlini93
Copy link
Author

Merlini93 commented Jun 26, 2024

定位bug在TZImageManager.h中130行

[PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAlbumRegular options:nil]获取不到相册

替换为[PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumRecentlyAdded options:nil]后可以获取到最近添加的相册

然后在- (BOOL)isCameraRollAlbum:(PHAssetCollection *)metadata 方法中判断系统版本
if (version >= 800 && version <= 802)
替换为
if (version >= 800 && version <= 802 || (version >= 180 && version < 190))
可以修复bug,希望作者可以做下兼容。

@banchichen
Copy link
Owner

感谢反馈,已经修复了。把PHAssetCollectionSubtypeAlbumRegular换成PHAssetCollectionSubtypeAny后可以了

已经发布3.8.6版本

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

No branches or pull requests

2 participants