Git Product home page Git Product logo

Comments (13)

ondrejhanslik avatar ondrejhanslik commented on May 23, 2024

I have done a similar implementation myself for my company and my recommendation is to create a separate UIWindow for the alerts. It then makes rotation and queing very simple. With this implementation you will have problems to display alerts on top of popovers / modal controllers.

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

I'm interested to see how that works. My current work in progress (7e6b9fb) uses the same UIWindow for multiple alerts, just like UIAlertView does. The problem right now is that auto-layout doesn't move a previously shown alert until after the re-appearing animations have finished (which makes it jump). When presenting a brand new alert, this doesn't happen because auto-layout happens earlier. So multiple UIWindows would solve that problem, but since I'm pretty close figuring it out with just one window, I want to put some more effort in that first.

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

0ded56b fixes this issue.

from sdcalertview.

bartzy avatar bartzy commented on May 23, 2024

Sorry for bringing this up from 4 years ago - but is this implemented in the new UIAlertController-like API?

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

Unfortunately it is not 😕

from sdcalertview.

bartzy avatar bartzy commented on May 23, 2024

Thanks. Is the way to do it is via multiple UIWindows?

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

No the current way to do it is to present the next alert from the previous one, which might work for you but is far from ideal.

from sdcalertview.

bartzy avatar bartzy commented on May 23, 2024

Why not with different UIWindows?

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

Sure that could work as well, but is probably more work as you have to manage all these windows somehow.

from sdcalertview.

bartzy avatar bartzy commented on May 23, 2024

Displaying the next alert from the previous one is also not very straight-forward - you'd need a queue for the next alerts, something that drains it when the presentation is done (if you'll present while a presentation is not complete you'll get an error).

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

Yep for sure. Depends a bit on the use-case: if you want to be able to show to alerts right after each other I wouldn't start juggling windows, but if you have N alerts that could show at any given point you might have to write some abstractions to make it nice.

Ideally this is just part of the library but I ran into some tricky stuff and was never able to solve all problems/edge cases. Since nobody really seemed to care too much about the lack of this functionality I eventually stopped pursuing it.

from sdcalertview.

bartzy avatar bartzy commented on May 23, 2024

It would be very nice to have as part of the library :)
My use-case is that I want to display alerts one after the other, without the user accepting any alert (meaning just blasting a bunch of alerts to the screen that the user then needs to handle/dismiss one at a time).
The thing is, is I get a notification from the system (open URL) and need to show an alert. Then after a very short while I get another one, while the first alert is still in the presentation process (but not yet presented). And then, I'm in a problem - How can I queue the 2nd alert to present immediately after the first one completed presenting?

from sdcalertview.

sberrevoets avatar sberrevoets commented on May 23, 2024

Yeah it’s a tough case that’s unfortunately unsupported and pretty hard to get right so I’m afraid I don’t have a good answer at the moment.

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.