I want to click on each cell to activate push segue, but since view controllerit is always in edit mode, I cannot click on the cells. In editing modeI zoomed reorder controllerin to cover the whole cell, and then made it invisible so that you can drag to reorder tableviewfrom anywhere in the cell, so when I click on cells in edit mode, I actually click on the reorder controller. Please do not tell me to set the tableview property allowsSelectionDuringEditingto YES, as I have already done this, and it still does not allow me to select a cell, because it is covered by the reordering controller that was added to the cell as a subview.
My solution was to prepare a new one push segueusing gestures tapin cell, which would be activated even if the cell was covered with it reorder controller. However, the data that is sent to viewwhich is called segueis always the first cellregardless of which cell I click on. Why is this happening? Any help is appreciated.
this is how i changed my control order
-(void) resizeReorderControl: (UITableView *)tableView reorderCell:(UITableViewCell *)bCell{
UIView* reorderControl = [bCell huntedSubviewWithClassName:@"UITableViewCellReorderControl"];
UIView* resizedGripView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetMaxX(reorderControl.frame), CGRectGetMaxY(reorderControl.frame))];
[resizedGripView addSubview:reorderControl];
[bCell addSubview:resizedGripView];
CGSize sizeDifference = CGSizeMake(resizedGripView.frame.size.width - reorderControl.frame.size.width, resizedGripView.frame.size.height - reorderControl.frame.size.height);
CGSize transformRatio = CGSizeMake(resizedGripView.frame.size.width / reorderControl.frame.size.width, resizedGripView.frame.size.height / reorderControl.frame.size.height);
CGAffineTransform transform = CGAffineTransformIdentity;
transform = CGAffineTransformScale(transform, transformRatio.width, transformRatio.height);
transform = CGAffineTransformTranslate(transform, -sizeDifference.width / 2.0, -sizeDifference.height / 2.0);
[resizedGripView setTransform:transform];
for(UIImageView* cellGrip in reorderControl.subviews)
{
if([cellGrip isKindOfClass:[UIImageView class]])
[cellGrip setImage:nil];
}
}
source
share