jdg / MBProgressHUD

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

MBProgressHUD in didSelectRowAtIndexPath #368

Closed PaulRBerg closed 8 years ago

PaulRBerg commented 8 years ago

The library is easy to use and lightweight in terms of understanding it, but there seems to be a problem. If I call showHUDAddedTo in a normal context (eg: button tapped), it is added and everything is ok, but if I call the same method inside the tableView's didSelectRowAtIndexPath, after I deselect the row by using tableView.deselectRowAtIndexPath, the progress won't show. I verified if there is a problem with the table view controller, but I don't think so, as when I tap another button on the page the progress shows up. Does the tableView's select method retain the view or something like that? And what is to be done to solve this?

yas375 commented 8 years ago

What view do you pass in showHUDAddedTo:? I don't think you should pass in a cell. I guess you will need to pass in your view controller's view or even its window depending on what other things do you want to disable for the user while hud is presented.

PaulRBerg commented 8 years ago

@yas375 I am passing the view controller's view, but it does not work.

yas375 commented 8 years ago

I would expect issues in this situation if you are adding UITableViewController. Because its view is UITableView and we shouldn't add subviews to it. And this library is actually just adds itself as a subview to the view you pass in... Not sure what to suggest here. In our app we are adding MBProgressHud to main window. We are kind of having a global hud which is not ideal too...