Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling "canReorder" #20

Closed
adamrushy opened this issue Jan 3, 2014 · 4 comments
Closed

Calling "canReorder" #20

adamrushy opened this issue Jan 3, 2014 · 4 comments

Comments

@adamrushy
Copy link

BVReorderTableView *reorder = [[BVReorderTableView alloc] init];
reorder.canReorder = NO;

It doesn't seem to be working for me, any clues?

@bvogelzang
Copy link
Owner

Hmm this could be a bug. Could you give me more info about what you're trying to do?

Are you trying to stop re-ordering all together i.e. re-ordering without the long press gesture? Using canReorder will only control long press re-ordering for the table. You have to use UITableView's delegate methods and properties to stop re-ordering all together.

@adamrushy
Copy link
Author

I am going to remove re-ordering from 2 Sections in my UITableView.

For example;

if (indexPath.section == 0) {
BVReorderTableView *reorder = [[BVReorderTableView alloc] init];
reorder.canReorder = NO;
}

Is this the right approach?

@bvogelzang
Copy link
Owner

No that is not the right approach. canReorder is used to disable re-ordering globally and not on a row by row basis. You should be using the tableView:canMoveRowAtIndexPath: datasource method to control this. For example:

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return NO;
    }
    return YES;
}

@adamrushy
Copy link
Author

I already tried this previously, not working as it should do..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants