Esqarrouth / EZLoadingActivity

:hatching_chick: Lightweight Swift loading activity for iOS7+
MIT License
607 stars 82 forks source link

Loading indicator doesnt hide #4

Closed Persilos closed 9 years ago

Persilos commented 9 years ago

Hi, The indicator doesnt hide when i call the hide method. But this hide after a few second after i passed on the hide method ( +/-10 seconds)

After this, when i continue to press my button for show the indicator, this doesnt show.

Persilos commented 9 years ago

I used it with a tableView. The indicator is show when i press a button on a cell of my tableView, and hide when i reload my data of my tableView (i dont know if these informations can help you)

Esqarrouth commented 9 years ago

Hello, are you using the old version or the new version?

It should hide immediately in all cases, unless you have show animations active. Press cmd+T in your simulator.

If you set disableUI: true then failed to hide the activity view, the UI won't respond to user touches.

Check these out if they help and let me know if they don't

Esqarrouth commented 9 years ago

Try it with this fix: https://github.com/goktugyil/CozyLoadingActivity/pull/5

Esqarrouth commented 9 years ago

hello, i pushed a new commit. all the problems should be solved right now

Persilos commented 9 years ago

Thank you, I found my mistake. I was calling hide function in the completionHandler of my API to consume my RESTservice. I just add this

dispatch_async(dispatch_get_main_queue(), { () -> Void in //self.view.subviews.last!.hidden = true CozyLoadingActivity.hide(success: true, animated: false) })

To execute hide function in the main thread and it's work perfectly. Thank you guys :)

thellimist commented 9 years ago

@Persilos with https://github.com/goktugyil/CozyLoadingActivity/commit/22ea18802119eaf55438f01873d3c27a373eb7c6 commit you won't have to use dispatch_async(dispatch_get_main_queue() when you call CozyLoadingActivity.hide in a background thread