UITableViewCell doesn't get deselected when swiping back quickly

后端 未结 16 1370
甜味超标
甜味超标 2021-01-29 23:49

I\'ve now updated three of my apps to iOS 7, but in all three, despite them not sharing any code, I have the problem where if the user swipes to go back in the navigation contro

16条回答
  •  醉话见心
    2021-01-30 00:37

    This worked best for me:

    - (void)viewDidLoad {
        [super viewDidLoad];
        self.clearsSelectionOnViewWillAppear = NO;
    }
    
    -(void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
        [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
    }
    

    I even got a much better unselect fading while I was swiping back slowly.

提交回复
热议问题