セルへの参照を非常に簡単に取得できます
cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
ただし、編集/並べ替えモードでは、セルの右側にある小さなハンドルへの参照を取得する必要があります。これどうやってするの?
セルへの参照を非常に簡単に取得できます
cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
ただし、編集/並べ替えモードでは、セルの右側にある小さなハンドルへの参照を取得する必要があります。これどうやってするの?
このコードで見つけることができますが、reorder-controlはprivate-apiです
for (UIView *view in cell.subviews) {
if ([NSStringFromClass([view class]) isEqualToString:@"UITableViewCellReorderControl"]) {
// 'view' is the reorder control
}
}
editingAccessoryView
セルのプロパティを使用する必要があります:
cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
UIView *editingAccessory = cell.editingAccessoryView;