jdg / MBProgressHUD

MBProgressHUD + Customizations
http://www.bukovinski.com/
MIT License
16.01k stars 3.56k forks source link

call hide twice cause hide the same view #377

Open sunnyjoe opened 8 years ago

sunnyjoe commented 8 years ago

add status so that when call hide twice quickly before the first hidden animation finish, we will not hide the same view twice. I think it is because the run loop break the view animation into piece, the main thread will proceed the second hide request before the animation finished

matej commented 8 years ago

Can you avoid calling hide twice? It will still work, just result in the HUD disappearing immediately instead of animating. To me it sounds like the caller would need to make sure this does not happen.

matej commented 8 years ago

I guess https://github.com/jdg/MBProgressHUD/pull/89 is relevant here.

sunnyjoe commented 8 years ago

no the problem is still there. because hide with animation will perform animation before remove from the super view. if you call another hide, the method simply find the subview and perform hidding action, the subview found maybe the view in previous performing hidding animation. it is the root reason, if you cannot make sure the unique subview called, this problem may cause other bugs.

Sent from my iPhone

On 19 Jun 2016, at 7:13 PM, Matej Bukovinski notifications@github.com wrote:

Can you avoid calling hide twice? It will still work, just result in the HUD disappearing immediately instead of animating. To me it sounds like the caller would need to make sure this does not happen.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

matej commented 8 years ago

Ah, you're referring to hideHUDForView:animated:.