需求:点击空白收起筛选table
我在view加了tap手势, 点击空白,确实可以收起下拉筛选了,但是点击大table的cell不能跳转了!!!
`__weak typeof(self)weakSelf = self;
UITapGestureRecognizer *tableTap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
[weakSelf foldHeaders];
}];
[self.view addGestureRecognizer:tableTap];`
设置cancelsTouchesInView这个属性就行了
__weak typeof(self)weakSelf = self;
UITapGestureRecognizer *tableTap = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
[weakSelf foldHeaders];
}];
tableTap.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:tableTap];``