나는 사용자 정의 셀이있는 UITableView
이 있습니다. 이 사용자 지정 셀에서이 테이블의 편집 모드를 트리거하는 UILongPressGestureRecognizer
을 정의했습니다. 누군가가 1.5 초 동안 셀을 누르고 있으면 편집 모드가됩니다.트리거 setEditing : 애니메이션 : 편집 버튼을 사용하지 않고
- (void)startEditMode:(UISwipeGestureRecognizer *)recognizer {
if (self.allowEdit) {
UITableView *table = (UITableView *)self.superview;
[table setEditing:YES animated:YES];
}
}
을하지만 내가 원하는 것은 내가/보여이 경우 몇 가지 추가 버튼을 숨길 필요가 있기 때문에 테이블이 편집 모드로 전환 할 때 감지 할 수 있습니다 : 트리거
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startEditMode:)];
. 하지만 내의 ViewController에서 어떤 이유로이 실행되지 않습니다 :
- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
NSLog(@"SET EDITING");
[super setEditing:editing animated:animated];
}
어떤 제안 왜? 이것은 UINavigationController에서 기본적으로 제공되는 적절한 편집 단추를 사용할 때 호출되는 것입니까?
또는 UITableView가 편집 모드로 전환되는 것을 어떻게 감지합니까?