Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to move uitableview custom cell?
    primarykey
    data
    text
    <p>I use custom cell.I want to move this cell (change position of the cells)</p> <p>i used this delegations</p> <p>UITableViewDataSource,UITableViewDelegate</p> <pre><code>-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *Cellidentifier = @"Celledit"; CellEdit *editCell =[tableView dequeueReusableCellWithIdentifier:Cellidentifier]; if (!editCell) { editCell = [[CellEdit alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Cellidentifier]; } MItem *mItem = [mItems objectAtIndex:[indexPath row]]; --------------------------------- // set data 3 labales in the cell --------------------------------- editCell.editdelegate = self; return editCell; </code></pre> <p>editcell is my custom cell</p> <p><code>[_tableViewEdit setEditing:YES animated:YES];</code> this line put in <code>- (void)viewDidLoad</code> </p> <p>i want to edit it always </p> <pre><code> // table view change cells - (UITableViewCellEditingStyle) tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{ return UITableViewCellEditingStyleNone; } - (BOOL) tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (void) tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath { NSInteger sourceRow = sourceIndexPath.row; NSInteger destRow = destinationIndexPath.row; id object = [minutesItems objectAtIndex:sourceRow]; [minutesItems removeObjectAtIndex:sourceRow]; [minutesItems insertObject:object atIndex:destRow]; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ for (UIControl *control in cell.subviews) { if ([control isMemberOfClass:NSClassFromString(@"UITableViewCellReorderControl")] &amp;&amp; [control.subviews count] &gt; 0) { for (UIControl *someObj in control.subviews) { if ([someObj isMemberOfClass:[UIImageView class]]) { UIImage *img = [UIImage imageNamed:@"logocoffee.png"]; ((UIImageView*)someObj).frame = CGRectMake(0.0, 0.0, 43.0, 43.0); ((UIImageView*)someObj).image = img; } } } } } } </code></pre> <p>to move the cell simulator not showing right side control icon</p> <p>why this? that means cant move costume cells?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload