Can't make it to work - hidden it break the logic
i used everything from your readme and when i use:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
WorkoutExerciseListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutExerciseListCell" forIndexPath:indexPath];
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
return cell;
}
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
then each row hides after drop. Here is result with 'hidden = YES' https://www.dropbox.com/s/qsmj02kddo1wlds/bug%20sort%201.mov?dl=0
and here is result with 'hidden = NO', everything looks like fine except that sometimes there is 'non-configured' cell (at my video it has name "name of timer": https://www.dropbox.com/s/xfbmharmie0lj4x/bug%20sort%202.mov?dl=0
what to do? What i missed?
if i use like this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
WorkoutExerciseListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutExerciseListCell" forIndexPath:indexPath];
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
} else {
cell.hidden = NO;
[self configureCell:cell atIndexPath:indexPath];
}
return cell;
}
then everything looks fine
I guess you're using the automatic rowHeight?
Check this https://github.com/LavaSlider/UITableView-Reorder/issues/4
nope, i woud like to use this new feature of IOS tables, but for me it somehow does not work. So my height came from:
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
and as i said, if i set:
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
} else {
cell.hidden = NO;
[self configureCell:cell atIndexPath:indexPath];
}
everything is working fine!
What do you put inside -(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath ?
as you wrote at readme:
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
return (([indexPath compare:self.selectedIndexPath] != NSOrderedSame) ? cellHeightCollapsed : cellHeightExpanded);
}
but it has nothing with height, it's hidden. if i 'patch' hidden property, then everything is fine
First, I didn't write the readme ;), second, what does happen when you write it like this:
`-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
[self configureCell:cell atIndexPath:indexPath];
WorkoutExerciseListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutExerciseListCell" forIndexPath:indexPath];
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
return cell;
}
return cell;
}`
well, it's very strange: at one viewcontroller - everything is ok:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
UITableViewCell *cell;
if([indexPath compare:self.selectedIndexPath] == NSOrderedSame)
cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutCellExpanded" forIndexPath:indexPath];
else
cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutCellCollapsed" forIndexPath:indexPath];
[self configureCell:cell atIndexPath:indexPath];
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
}
return cell;
}
, but at another still same problems:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
indexPath = [tableView dataSourceIndexPathFromVisibleIndexPath: indexPath];
WorkoutExerciseListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WorkoutExerciseListCell" forIndexPath:indexPath];
[self configureCell:cell atIndexPath:indexPath];
if( [tableView shouldSubstitutePlaceHolderForCellBeingMovedAtIndexPath: indexPath] ) {
cell.hidden = YES;
}
return cell;
}
but my workaround with 'hidden=NO' as i wrote before - works fine in both cases