I have the following code in my DataSource class
public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath)
{
return true;
}
pub开发者_如何学Clic override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
{
... code for swapping the location of stuff in a list
}
How do I trigger a 'move'? If I swipe my UITableView I get my delete button, but how do I get a 'move'? Do I need to put a button and then put the table into a BeginEditting mode first? Any sample code for doing that?
In order to get the table to allow you to perform the move action, you need to set the table into "editing" mode ( tableView.Editing = true;
).
精彩评论