CEWendel / SWTableViewCell

An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)
MIT License
7.13k stars 1.27k forks source link

修复iOS 14闪退,以及tableview点击的问题修复 #438

Open albertjson opened 10 months ago

albertjson commented 10 months ago
    [self.contentView superview];// iOS14 加入这行代码可解决闪退问题,但是会导致table select规律失效
    //不需要兼容ios 7了 故注释下面部分
    //if (![NSStringFromClass([[self.subviews objectAtIndex:0] class]) isEqualToString:kTableViewCellContentView])
    //{
    //    // iOS 7
    //    contentViewParent = [self.subviews objectAtIndex:0];
    //    clipViewParent = self;
    //}
//处理tableview点击失效问题
- (void)scrollViewTapped:(UIGestureRecognizer *)gestureRecognizer
{
    if (_cellState == kCellStateCenter)
    {
        if (self.shouldHighlight) // UITableView refuses selection if highlight is also refused.
        {
            [self selectCell];
        }else {
            [self deselectCell];
        }
    }
    else
    {
        // Scroll back to center
        [self hideUtilityButtonsAnimated:YES];
    }
}