0
votes

I'm using ECSlidingViewController in my app. I have a View Controller with a UITableView in it, which uses a UIRefreshControl to execute a long task. When I pull down to refresh, the refresh control starts animating normally but when I go to the top view controller (my main menu in this case) and then go back to my view controller, the refreshControl freezes completely until the task is completed.

To make it clearer, these are the steps I follow:

  1. Pull down my tableView to refresh it.
  2. A long task is executed on background, like:

    - (void)pulledToRefresh:(UIRefreshControl *)refreshControl
    {
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
            long long a = 0;
            for (long long i = 0; i < 100000000000; i++) {
                a++;
            }
            dispatch_async(dispatch_get_main_queue(), ^{
                [refreshControl endRefreshing];
            });
        });
    }
    
  3. While the refresh control is animating, I slide (I don't call the resetTopView:animated: method or any of those ones, I just make a pan gesture) my current view controller to the right to show my Main Menu. When this happens, the refresh control suddenly stops animating (it freezes).

  4. I go back to the view controller I was using at first but it remains frozen.

  5. The task completes and the refresh control ends the refresh naturally, removing itself from my tableView with a nice animation.

Any idea why this happens?

1
This may be a bug in ECSlidingViewController. See github.com/ECSlidingViewController/ECSlidingViewController/… - Michael Enriquez
Good to know that you guys are still working in this and are aware of this bug. Thanks! - Alex Takashi Tanabe
I just pushed a fix for this. Give the latest master branch a try and let me know how it works for you. - Michael Enriquez
It works perfect! Thanks for the quick response! - Alex Takashi Tanabe
Sorry Michael! I've give it a second shot and it seems it still doesn't work =/ - Alex Takashi Tanabe

1 Answers

0
votes

I may have found a solution for this.... Changing the "detectPanGestureRecognizer" method to below, seems to be working for me...

- (void)detectPanGestureRecognizer:(UIPanGestureRecognizer *)recognizer {
if (recognizer.state == UIGestureRecognizerStateBegan) {
    _isInteractive = YES;
}
dispatch_async(dispatch_get_main_queue(), ^{
    [self.defaultInteractiveTransition updateTopViewHorizontalCenterWithRecognizer:recognizer];
});
_isInteractive = NO;

}