Ios Rearrange cells in tableview during runtime

Ios Rearrange cells in tableview during runtime,ios,iphone,uitableview,Ios,Iphone,Uitableview,Could someone please point me in the right direction on how to allow the cells to be able to move in a UITableView? At the moment when I click and hold and then drag below the second cell it doesn't move. It just drags all the cells with it and stretches back up again. I would like to be able to move the cells so I can basically rearrange the cells during runtime. can someone please help me.

Could someone please point me in the right direction on how to allow the cells to be able to move in a

UITableView
?

At the moment when I click and hold and then drag below the second cell it doesn't move. It just drags all the cells with it and stretches back up again.

I would like to be able to move the cells so I can basically rearrange the cells during runtime. can someone please help me.


#1

This is functionality that the UITableView provides for you.

Check the Managing the Reordering of Rows section in the TableView Programming Guide.


#2

You can only rearrange tableview cells when in edit mode.

look for this line of code within your program :

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem; 

It should be commented if you haven't touched it yet.

cheers !

Kyle


#3

Try this

- (void) tableView:(UITableView *)tableView
moveRowAtIndexPath:(NSIndexPath *)fromIndexPath 
       toIndexPath:(NSIndexPath *)toIndexPath 

#4

This is functionality that the UITableView provides for you.

Check the Managing the Reordering of Rows section in the TableView Programming Guide.


#5

You can only rearrange tableview cells when in edit mode.

look for this line of code within your program :

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem; 

It should be commented if you haven't touched it yet.

cheers !

Kyle


#6

Try this

- (void) tableView:(UITableView *)tableView
moveRowAtIndexPath:(NSIndexPath *)fromIndexPath 
       toIndexPath:(NSIndexPath *)toIndexPath