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

Album List is not showing #347

Open
irfanabdulkhaliq opened this issue Dec 21, 2022 · 1 comment
Open

Album List is not showing #347

irfanabdulkhaliq opened this issue Dec 21, 2022 · 1 comment

Comments

@irfanabdulkhaliq
Copy link

let options = imagePicker.settings.fetch.album.options
imagePicker.settings.fetch.album.fetchResults = [
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: options),
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .any, options: options)
// PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: options),
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumFavorites, options: options),
PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: options),
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumSelfPortraits, options: options),
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumPanoramas, options: options),
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumVideos, options: options)

    ]

Above code is not working on IOS 16. Anyone who knows how to show album list while selecting photo.

@BangGahee
Copy link

BangGahee commented Jan 30, 2023

Set it up before you present the imagepicker.

    let imagePicker = ImagePickerController()
    imagePicker.settings.selection.max = self.imageCount
    imagePicker.settings.fetch.assets.supportedMediaTypes = [.image]
        
    let options = imagePicker.settings.fetch.album.options
    imagePicker.settings.fetch.album.fetchResults = [
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: options),
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .any, options: options),
        // PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: options),
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumFavorites, options: options),
        PHAssetCollection.fetchAssetCollections(with: .album, subtype: .albumRegular, options: options),
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumSelfPortraits, options: options),
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumPanoramas, options: options),
        PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumVideos, options: options)
    ]
    
    self.presentImagePicker(imagePicker, select: { (asset) in 
    ......... 
    }

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