Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Controller/ImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import Photos
let fetchOptions = settings.fetch.assets.options.copy() as! PHFetchOptions
fetchOptions.fetchLimit = 1

return settings.fetch.album.fetchResults.filter {
return settings.fetch.album.fetchResults().filter {
$0.count > 0
}.flatMap {
$0.objects(at: IndexSet(integersIn: 0..<$0.count))
Expand Down
8 changes: 5 additions & 3 deletions Sources/Model/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ import Photos
/// PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumSelfPortraits, options: options),
/// PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumPanoramas, options: options),
/// PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumVideos, options: options),
public lazy var fetchResults: [PHFetchResult<PHAssetCollection>] = [
PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: options),
]
public lazy var fetchResults: () -> [PHFetchResult<PHAssetCollection>] = { [options] in

Choose a reason for hiding this comment

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

Suggested change
public lazy var fetchResults: () -> [PHFetchResult<PHAssetCollection>] = { [options] in
public lazy var fetchResults: () -> [PHFetchResult<PHAssetCollection>] = {

return [

Choose a reason for hiding this comment

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

Suggested change
return [
[

PHAssetCollection.fetchAssetCollections(with: .smartAlbum, subtype: .smartAlbumUserLibrary, options: options),
]
}
}

@objc(BSImagePickerAssets)
Expand Down