Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
View Not Cleared With Multiple BlockAlertView's Triggered by UIButton #24
Triggering a BlockAlertView via UIButton before the current BlockAlertView has finished it's dismissal animation causes the BlockAlertView to stay in the view, not allowing the user to dismiss it. The next BlockAlertView executes [alert show] before the previous BlockAlertView has time to execute it's completion block which clears the view.
Steps to Reproduce
This has been tested with the Trunk as well as BinaryDev's ARC-compatible branch. To be thorough I included a stack trace below.
I forked the trunk and came up with a possible solution (https://github.com/nickalto/BlockAlertsAnd-ActionSheets) that makes each BlockAlertView atomic, so you can only trigger another alert after the current one has completely finished animating and executing it's completion block. The only draw back is that it doesn't allow for one BlockAlertView to trigger another BlockAlertView. A queue could be implemented to maintain this functionality and atomicity. I would love feedback to see if this warrants a pull request or if anyone has suggestions on better fixes.
I was just wrestling with this - I don't have the time to work on a fix, but hope to come back to it a bit later. Thought I'd note my observation here....
The BlockBackground is the object that is made a key window. This is a singleton object and it holds onto the original keywindow, so that when it goes away, it can yield back the original window.
It holds any sheets as subviews - so when several are added, the singleton object has a hierarchy of views.
I think there is something wrong with the hierarchy at this point that prevents the view from having its property set, and hence we get views we can see, but who's dismiss button we can't press.
I have been peeking in the debugger at the view hierarchy at this point using the handy-dandy 'po [view recursiveDescription]' but I've run out of time to fuss with it.