Re: Moving cells in a UITableView
On May 17, 2019, at 14:09 , Carl Hoefs wrote: > > Is this a bug, or is it documented behavior? > > Without the following setting: > >self.tableView.autoresizingMask |= UIViewAutoresizingFlexibleWidth; > > a UITableView won't permit reordering of the table's cells. I think the problem is that reordering requires the cells to be dragged by the reordering control at the right-hand end. If your cells don’t resize properly, the reordering control can be outside the table view, and reordering can’t be done. You need to make sure the cells resize properly (and autolayout is probably a better choice than autoresizing masks). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Moving cells in a UITableView
Is this a bug, or is it documented behavior? Without the following setting: self.tableView.autoresizingMask |= UIViewAutoresizingFlexibleWidth; a UITableView won't permit reordering of the table's cells. -Carl > On May 16, 2019, at 8:38 PM, Carl Hoefs > wrote: > > The problem boils down to this: If a UITableView doesn't have inner-width > autoresizing enabled, the table won't get the 'move row' ability. > > Q: How can I set this property on the UITableView programmatically? > > -Carl > > >> On May 16, 2019, at 2:29 PM, Carl Hoefs >> 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? >> >> -Carl >> >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> 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: >> https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu >> >> This email sent to newsli...@autonomy.caltech.edu > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu > > This email sent to newsli...@autonomy.caltech.edu ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Moving cells in a UITableView
The problem boils down to this: If a UITableView doesn't have inner-width autoresizing enabled, the table won't get the 'move row' ability. Q: How can I set this property on the UITableView programmatically? -Carl > On May 16, 2019, at 2:29 PM, Carl Hoefs > 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? > > -Carl > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/newslists%40autonomy.caltech.edu > > This email sent to newsli...@autonomy.caltech.edu ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Moving cells in a UITableView
On May 16, 2019, at 14:29 , Carl Hoefs 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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Moving cells in a UITableView
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? -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com