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

Multiple Selection mode crash when photo library is empty #347

Closed
daveleenew opened this issue May 9, 2019 · 6 comments
Closed

Multiple Selection mode crash when photo library is empty #347

daveleenew opened this issue May 9, 2019 · 6 comments

Comments

@daveleenew
Copy link

daveleenew commented May 9, 2019

Describe the bug
Multiple Selection mode crash when photo library is empty

Temporary solution:

YPLibraryVC.swift

if selection.isEmpty {
///Temporary solution:
if(mediaManager.fetchResult.count == 0){return}

            let asset = mediaManager.fetchResult[currentlySelectedIndex]
            selection = [
                YPLibrarySelection(index: currentlySelectedIndex,
                                   cropRect: v.currentCropRect(),
                                   scrollViewContentOffset: v.assetZoomableView!.contentOffset,
                                   scrollViewZoomScale: v.assetZoomableView!.zoomScale,
                                   assetIdentifier: asset.localIdentifier)
            ]
        }

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Xcode Version [e.g. 9.4.1]
  • Swift Version [e.g. 4.1]

Installation Type

  • Carthage
  • Cocoapods
  • Manual

Additional context
Add any other context about the problem here.

@daveleenew daveleenew changed the title MultipleSelection model crash when photo library is empty. MultipleSelection mode crash when photo library is empty. May 9, 2019
@daveleenew daveleenew changed the title MultipleSelection mode crash when photo library is empty. Multiple Selection mode crash when photo library is empty May 9, 2019
@aegzorz
Copy link

aegzorz commented May 23, 2019

We're seeing the same crashes in our app.

@victormihaita
Copy link

@daveleenew what is the status for this issue?

@daveleenew
Copy link
Author

daveleenew commented May 31, 2019 via email

@Vollando
Copy link

Having similar issue where pressing multiple selection button after denying photo library access permission results in a crash

@angelo-RSVP
Copy link

angelo-RSVP commented Jul 12, 2019

I don't know why the sample app isn't showing the multiple button until permission is granted. Is there a configuration for it?

Update: Just hid the button on first launch until permission is checked

public override func viewDidLoad() {
super.viewDidLoad()
. . .
v.assetViewContainer.multipleSelectionButton.isHidden = true
}

@s4cha
Copy link
Member

s4cha commented Dec 10, 2019

This should be fixed with @hansemannn PR. It will be in the next version, hopefully by the end of the week.

@s4cha s4cha closed this as completed Dec 11, 2019
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

6 participants