raweng / stack-scroll-view

Stack Scroll View Panel like Twitter Ipad app for iOS developers [iPad]
http://www.raweng.com
Other
379 stars 145 forks source link

unable to reorder using default table reordering methods #30

Closed djgooner closed 12 years ago

djgooner commented 12 years ago

Take the sample app from the github, and place the following in the dataviewcontroller class.

//this in the - (id)initWithFrame:(CGRect)frame [_tableView setEditing:YES];

// then these two methods.

pragma mark Row reordering

// Determine whether a given row is eligible for reordering or not.

// Process the row move. This means updating the data model to correct the item indices.

}

i see the table with the reordering indicators. but nothing happens when i try to drag. but put a breakpoint on the second method, moveRowAtIndexPath. and tap on the three line icon for reordering, the method gets called. So something is stopping from selecting and dragging. i am still looking in to this but if anyone has any suggestions will be greatly appreciated.

Reefaq commented 12 years ago

Hey try out the solution which i posted here https://github.com/raweng/StackScrollView/issues/27

its working on my side with the solution above !

let me know if its doesn't work for you :)

djgooner commented 12 years ago

Thanks that partially worked, i had to modify the second the method to

-(BOOL) gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldReceiveTouch:(UITouch )touch { NSString *className = [NSString stringWithFormat:@"%@", touch.view.class]; if ([className isEqualToString:@"UITableViewCellReorderControl"]) { return NO; } return YES; }

When touching the tableCell with the reorder control, table.view class was returning, "UITableViewCellReorderControl"

but in the method [touch.view isKindOfClass:[UIControl class]] i could not replace it with [UITableViewCellReorderControl class] for some reason, even though i imported UIKit/UIKit.h