New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dismissWithDelay it's broken #647
Comments
me to ~ |
Working on a fix. However, PR are always welcome. |
Should be fixed with the latest commit, please check the current master and provide feedback. |
No feedback at all? This is sad. Questions and issues like this, are the reason people burn out on open source. Don't let others do your work, give good questions, follow issue guidelines, provide a demo project or tell what you have already done to solve the problem. Also give feedback if required! This is a matter of respect for the programmers that make a lot of efforts on writing open source components. |
Dear Honkmaster, apologies for the lack of feedback, I didn't integrated the latest version of SVProgressHud on the project I was working, I kept going with my patched version as I was close to the deadline. I modified slightly the ViewController.m,
What I noticed is that the HUD doesn't appear at all if used in this way, however, if the HUD is already visible (ex: trigger by "show" button) the it appears correctly and the delay it's respected. I had a quick look to your code and I boiled down the issue to the method in SVProgressHub.m:1032 Specifically in line 1095 where you have Between this and the fact that if you use breakpoints, everything works fine, everything suggest that there is a concurrency issue between the 2 operations (show and dismiss). Now as I'm writing it came to my mind to try to decouple the delay from the animation as it appears it messup the timing is used in conjunction with
Looks like it's working fine, however I have no idea if it has implications in other part of the project. ... I hope we can make peace ^_^ |
Man, my rant had an effect :). Thank you very much for the feedback, this is useful. From my understanding |
Funny thing btw (from my memories): I also tried something like
while fixing some related bugs and it was working for me. Ok, more feedback later. |
Ho yes it did, I reminded me when I'm overworked of it feels :P |
I don't know if it works for you but it never doest for me, I always endup cooking an extension to achieve a custom length:
extension SVProgressHUD{
static func dismissAfter(seconds:NSTimeInterval){
let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(seconds * Double(NSEC_PER_SEC)))
dispatch_after(delayTime, dispatch_get_main_queue()) {
SVProgressHUD.dismiss();
}
}
}
Rather simple but it just works (perhaps I misunderstand the purpose of dismissWithDelay)
My 2 cents ^_^
The text was updated successfully, but these errors were encountered: