Using PHFetchOptions with smart albums does not work

Originator:vray
Number:rdar://30403353 Date Originated:2/7/17
Status:Open Resolved:
Product:iOS Product Version:9.2.1
Classification: Reproducible:100%
 
Area:
Photos

Summary:
If you call PHAssetCollectionFetchAssetCollections with .smartAlbum as the PHAssetCollectionType argument then a non nil options argument does not affect the fetch results.

Steps to Reproduce:
    open func getAllAlbums() -> [PHAssetCollection] {
        var allAlbums = [PHAssetCollection]()
        let options: PHFetchOptions = PHFetchOptions()
        options.sortDescriptors = [NSSortDescriptor(key: "localizedTitle", ascending: false)]
        let smartAlbums = PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .any, options: options)
        let userCreatedOrSyncedAlbums = PHAssetCollection.fetchAssetCollections(with: .album, subtype: .any, options: options)
        smartAlbums.enumerateObjects(using: { (album,_, _) in
            allAlbums.append(album)
        })
        userCreatedOrSyncedAlbums.enumerateObjects(using: { (album,_, _) in
            allAlbums.append(album)
        })
        return allAlbums
    }

Expected Results:
Expected that the smart albums would be sorted alphabetically by localizedTitle just like the user created albums

Actual Results:
The smart albums are always in an arbitrary order. They are definitely not sorted by localizedTitle. 

Version:
iOS 9.2.1

Notes:


Configuration:
iPhone 6

Attachments:

Comments

Still exists

This bug still exists on iOS > 13.0


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!