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

fixed bug in showing select more photos options when defaultMultipleS… #18

Merged
merged 1 commit into from
Jan 20, 2023
Merged
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
8 changes: 6 additions & 2 deletions Source/Pages/Gallery/YPLibraryVC+CollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ extension YPLibraryVC {

/// Checks if there can be selected more items. If no - present warning.
func checkLimit() {
let isHidden = !isLimitExceeded || isMultipleSelectionEnabled == false
v.maxNumberWarningView.isHidden = isHidden
let isHidden = !isLimitExceeded || isMultipleSelectionEnabled == false
v.maxNumberWarningView.isHidden = isHidden
self.checkSelectMoreOptions(isHidden: isHidden)
}

func checkSelectMoreOptions(isHidden: Bool = true) {
if #available(iOS 14, *) {
let status = PHPhotoLibrary.authorizationStatus(for: .readWrite)
if status == .limited {
Expand Down
2 changes: 2 additions & 0 deletions Source/Pages/Gallery/YPLibraryVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ internal final class YPLibraryVC: UIViewController, YPPermissionCheckable {

if YPConfig.library.defaultMultipleSelection || selectedItems.count > 1 {
toggleMultipleSelection()
} else {
checkSelectMoreOptions()
}
}

Expand Down