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

On the Swift3 branch: Denying access to photo library, and presenting an alertController on top of presented image picker sheet => crash #97

Open
andreasemento opened this issue Nov 18, 2016 · 7 comments

Comments

@andreasemento
Copy link

The app crashes in the ImagePickerSheetController deinit method.
screen shot 2016-11-18 at 14 03 18

@BalestraPatrick
Copy link
Collaborator

Can you please describe how I could reproduce this crash in more details? Or provide a video if it's easier for you.

@andreasemento
Copy link
Author

Sure thing, here's a bit more information. I have reproduced the crash on a devicerunning iOS10 and simulator running both iOS9 and iOS10

Step by step, this is what happens.

  • I present the ImagePickerSheetController on my VC, and it asks for permission to access photos.
  • The user denies access to photos (and the "image strip" doesn't appear).
  • I then click a button on the IPSC ("pick image from photos), and the proper handler is invoked
  • This handler creates and presents a UIAlertController on the same VC, causing the ImagePickerSheetController to be dealloc'ed, and deinit is called. This is where the app crashes.

I have been through the exact same flow pre-swift3, and checked that the ImagePickerSheetController is dealloced correctly - it is.

@BalestraPatrick
Copy link
Collaborator

The issue here is that we try to access the user photos even if we're not allowed to. IMO, we shouldn't even show on screen the IPSC when we don't have the permission. My solution would be to implement an UIAlertController that says "Please allows this app to access your Photos.". When the "OK" button is pressed, the IPSC is automatically dismissed so that the user can't interact with it. What do you think about this option?

Any thoughts on your side @lbrndnr?

@andreasemento
Copy link
Author

Hmm, I think this depends on what the user puts in the two buttons. I appreciate that it most probably will be "image from photos" and "take picture" (camera) - but it could be stuff like "select image from dropbox", or "record voice message" instead. In these cases, the sheet controller should still be presented - but without the image strip methinks.

@kevinlee85
Copy link

Still no solution or any update for those issues?

@scottcc
Copy link

scottcc commented Mar 9, 2017

Yeah - fairly certain this library is now abandoned. Author is (if I understand correctly) working on a newer, iOS10-like-messages pane now.

@lbrndnr
Copy link
Owner

lbrndnr commented Mar 9, 2017

@kevinlee85 @scottcc Yes, that's the plan. I'm very busy with uni though so I haven't had time to work on it in a while...

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

5 participants