Advertisement
RRK

Drag and drop Cells

RRK
Oct 11th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. this function is called on click of button and dragged
  2.  
  3. - (void)dragCell:(CustomCell *)cell
  4. {
  5.     NSIndexPath *fromIndexPath = [m_tableView indexPathForCell:cell];
  6.    
  7.     NSArray *array1 = [Array2 objectAtIndex:[fromIndexPath row]];
  8.     [Array2] removeObjectAtIndex:[fromIndexPath row]];
  9.     [Array2] insertObject:page atIndex:[toDestIndexPath row]];//dont know how to get this toDestIndexPath
  10.    
  11.     [m_tableView moveRowAtIndexPath:fromIndexPath toIndexPath:toDestIndexPath];  
  12.    
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement