I need to have the possibility to put the selected line on the middle of frame, so if I select the first or the last row this row need to ben on the center and not clip to the top (or to the bottom) of the tableview, something like an uipickerview, this is my code on scrollwillendDragging:
with this code I create snap effect but rounded is not the correct row, changing the first and last cell height with a double height the problem disappear but I don't like this way.- (void)scrollViewWillEndDragging: (UIScrollView *)scrollView
withVelocity: (CGPoint)velocity
targetContentOffset: (inout CGPoint *)targetContentOffset {
CGFloat rowHeight = [delegate rowHeightForMyPickerView:self];
CGFloat floatVal = targetContentOffset->y / rowHeight;
NSInteger rounded = (NSInteger)(lround(floatVal));
targetContentOffset->y = rounded * rowHeight;
NSLog(@"Offset: %f Float: %f Row: %d",targetContentOffset->y,floatVal,rounded);
[delegate myPickerView:self isOverRow:rounded];
}