GithubHelp home page GithubHelp logo

On the Swift3 branch: Denying access to photo library, and presenting an alertController on top of presented image picker sheet => crash about imagepickersheetcontroller HOT 7 OPEN

andreasemento avatar andreasemento commented on June 12, 2024
On the Swift3 branch: Denying access to photo library, and presenting an alertController on top of presented image picker sheet => crash

from imagepickersheetcontroller.

Comments (7)

BalestraPatrick avatar BalestraPatrick commented on June 12, 2024

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

from imagepickersheetcontroller.

andreasemento avatar andreasemento commented on June 12, 2024

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.

from imagepickersheetcontroller.

BalestraPatrick avatar BalestraPatrick commented on June 12, 2024

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?

from imagepickersheetcontroller.

andreasemento avatar andreasemento commented on June 12, 2024

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.

from imagepickersheetcontroller.

kevinlee85 avatar kevinlee85 commented on June 12, 2024

Still no solution or any update for those issues?

from imagepickersheetcontroller.

scottcc avatar scottcc commented on June 12, 2024

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

from imagepickersheetcontroller.

lbrndnr avatar lbrndnr commented on June 12, 2024

@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...

from imagepickersheetcontroller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.