alexanderjarvis / PXAlertView

A drop-in replacement for UIAlertView that is more customisable and skinnable
MIT License
592 stars 95 forks source link

Non expected behavior when showing an alert inside the completion block from an other alert #20

Closed faesa closed 10 years ago

faesa commented 10 years ago

Thank you Alexander for making this great control available!

Problem: The second alert seems to have a randomly behavior. Indeed, sometimes it's displayed, sometimes not. And in all the cases, the bounce effect is not as smooth as the first alert. Do you have any idea?

Thanks a lot.

alexanderjarvis commented 10 years ago

This could be to do with the recent pull request that removes the alert level UIWindow (presumably after it is animated out).

faesa commented 10 years ago

OK. I have change this line [self.mainWindow makeKeyAndVisible]; with this one [self.mainWindow makeKeyWindow]; but the problem is still here.

alexanderjarvis commented 10 years ago

Try reverting commit 34323b43cfa949fa7fbd7c5ea2ddc8ac07aca65f

faesa commented 10 years ago

Sorry, what do you mean by revert commit?

faesa commented 10 years ago

It seems that the problem disappear when self.alertWindow.hidden is set to NO.

} completion:^(BOOL finished) { self.alertWindow.hidden = NO;//YES [self.alertWindow removeFromSuperview]; self.alertWindow = nil; [self.mainWindow makeKeyAndVisible]; }];

alexanderjarvis commented 10 years ago

Ok thanks for this insight. I'll look to make a change with the next version to fix this issue.

alexanderjarvis commented 10 years ago

Fixed

alekseypotapov-dev commented 9 years ago

Still have this issue. Solved by putting the next PXAlertView implementation into the completion block of first PXAlertView and wrap it with dispatch_after

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC), dispatch_get_main_queue(), ^{ /* [PXAlertView showAlertWithTitle .... */ });