Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add re-ordering the elements in the advanced editing sample for quest…

  • Loading branch information...
commit 62d5008c50ba3f5479c10a553451a6202af8d382 1 parent 001985e
@spouliot spouliot authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 Sample/DemoEditingAdvanced.cs
View
13 Sample/DemoEditingAdvanced.cs
@@ -41,6 +41,19 @@ public override void CommitEditingStyle (UITableView tableView, UITableViewCellE
var element = section [indexPath.Row];
section.Remove (element);
}
+
+ public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath)
+ {
+ return true;
+ }
+
+ public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
+ {
+ var section = Container.Root [sourceIndexPath.Section];
+ var source = section [sourceIndexPath.Row];
+ section.Remove (source);
+ section.Insert (destinationIndexPath.Row, source);
+ }
}
public override Source CreateSizingSource (bool unevenRows)
Please sign in to comment.
Something went wrong with that request. Please try again.