Git Product home page Git Product logo

Comments (4)

sberrevoets avatar sberrevoets commented on May 25, 2024

Your first problem is easily explained by the fact that UIActionSheet uses a separate window itself, and like you found out, that window is the key window, which is then captured and returned to after dismissing the alert. If you want to make that work together, you'd probably have to use actionSheet:didDismissWithButtonIndex: to wait for the original window to become the key window again. Then that window is captured and will be returned to.

A workaround like yours is pretty fragile, as the window at index 0 may not be the window the user intends to return to either.

I'm not sure what's going wrong in your second example, though. Could you give a code example?

from sdcalertview.

chadpod avatar chadpod commented on May 25, 2024

Looks like my second case is the same thing, as it is also triggered off the same action sheet. I'm surprised that viewDidAppear: is called on the presented modal vc before the _UIAlertOverlayWindow is gone. I agree the above solution is fragile, mostly why I opened the issue. Having said that, seems less fragile than without it? If it isn't a UIWindow, it is going to fail, unless you go the actionSheet:didDismissWithButtonIndex: route ... but if you do that, am I understanding you right, the window stored in _userWindow doesn't matter anyway?

from sdcalertview.

chadpod avatar chadpod commented on May 25, 2024

Going to go with the actionSheet:didDismissWithButtonIndex: solution. Thanks for the help.

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 25, 2024

It takes the current keyWindow and returns to that after dismissing the alert. If that keyWindow is a window specifically created for UIActionSheet or UIAlertView, or any other system UI for that matter, that will be the window the user is returned to.

Figuring out what the user really intended to return to is a lot harder than simply saying "sorry, but you're doing something that's not supported". I would say that that's something you're running into, and the easiest way to make it work is probably actionSheet:didDismissWithButtonIndex:.

Thanks for your input, much appreciated!

from sdcalertview.

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.