• You can reach us through
  • +91-984-5825982
  • +91-996-4689921
  • sales@cumulations.com
  •  Whatsapp Us!
iOS

How to Customize UITableView’s Editing Mode

Vishnu Kanth

03 Mar 2015

Customize UITableView's Editing Mode

We know in the UTableView you can set default edit mode by:

[tableView setEditing:YES animated:YES];

Then you can see something of this sort.

table view before

However, there are no methods to customize (change color/set image) the edit mode circle. Let’s say if you want to change the color from Blue to Orange, this is what you should be doing.

- (void)layoutSubviews
 
 {
 
  [super layoutSubviews]; 
 
  NSArray *vComp = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
 
  
 
  if ([[vComp objectAtIndex:0]intValue]>=7)
 
  {
 
  for (UIView* subview in [self subviews])
 
  {
 
  for(UIView *subsubview in subview.subviews)
 
  {
 
  if ([NSStringFromClass([subsubview class]) isEqualToString:@"UITableViewCellEditControl"])
 
  {
 
  if(isSelect == YES)
 
  {
 
  [subsubview setTintColor:[UIColor colorWithHexString:@"#FF5500"]];
 
  self.selectedBackgroundView.backgroundColor = [UIColor clearColor];
 
  }
 
  }
 
  }
 
  }
 
  }
 
  else if ([[vComp objectAtIndex:0]intValue]>=8)
 
  {
 
  for(UIView *subsubview in [self subviews])
 
  {
 
  if ([NSStringFromClass([subsubview class]) isEqualToString:@"UITableViewCellEditControl"])
 
  {
 
  [subsubview setTintColor:[UIColor colorWithHexString:@"#FF5500"]];
 
  self.selectedBackgroundView.backgroundColor = [UIColor clearColor];
 
  }
 
  }
 
  }
 
 }

 

After this, you should be able to see something like this.

table view after

We can also hide the editing mode circles and can be replaced with our own images.