Re: Moving cells in a UITableView
Re: Moving cells in a UITableView
- Subject: Re: Moving cells in a UITableView
- From: Quincey Morris <email@hidden>
- Date: Thu, 16 May 2019 18:38:55 -0700
On May 16, 2019, at 14:29 , Carl Hoefs <email@hidden> wrote:
>
> iOS 12.2
>
> I want to allow the user of my iPhone app to finger-reorder the rows in a
> UITableView.
>
> I set tableView.editing=YES, and I receive 2 callbacks for each row in the
> table:
>
> (1) -tableView:editingStyleForRowAtIndexPath: --> return
> UITableViewCellEditingStyleNone.
> (2) -tableView:canMoveRowAtIndexPath: --> return YES.
>
> (The table displays rows that are shifted to the right to allow for an
> editing icon (insert/delete), but as I am reordering rows, there's no icon
> displayed.)
>
> I cannot move the rows in the table.
> The callback -tableView:moveRowAtIndexPath:toIndexPath: does not get called.
>
> My code used to work pre-iOS 12. Am I using the wrong
> UITableViewCellEditingStyle?
I think you need cell.showsReorderControl = YES;
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden