JonasGessner / JGProgressHUD

An elegant and simple progress HUD for iOS and tvOS, compatible with Swift and ObjC.
MIT License
3.35k stars 336 forks source link

Feature Request: showAfterDelay #136

Closed mman closed 4 years ago

mman commented 4 years ago

Hi @JonasGessner, thanks for this great little library. I often use indeterminate progress indicators in a way to automatically pop up onscreen after certain delay, when a networking operation takes too long to complete. I often need to show them after one second, and then dismiss when operation completes. I use DispatchWorkItem to schedule [hud show] after delay on DispatchQueue.main.

Would be cool if the hud itself can be [hud showAfterDelay: 1] tracking the DispatchWorkItem internally and canceling it when [hud dismiss] is invoked.

Would you be interested for me to open a PR?

JonasGessner commented 4 years ago

Hey, sure! Sounds like you have a good design in mind for this, so feel free to go ahead with a PR.

JonasGessner commented 4 years ago

I'm not planning to implement this feature. If you want to create a PR, feel free. Otherwise I will close this issue.

mman commented 4 years ago

@JonasGessner Thanks for kicking me into doing it. It's in the https://github.com/JonasGessner/JGProgressHUD/pull/145. Hope I have not missed anything.

JonasGessner commented 4 years ago

Closed via #145. Thanks!