Left circle in UITableViewCell editing mode appears in iOS8

So, I just installed Xcode 6GM and played with my iOS7 app on a simulator with iOS8.

I have a UITableView that is in edit mode, and now there is a circle on the left side of the cell that does not appear when working on iOS7.

I took a look at the documentation for iOS8, but I don't see any new constants, and I use UITableViewCellEditingStyleNone and UITableViewCellSelectionStyleNone .

This circle disappears when tableView.editing = NO also allows MultipleSelectionDuringEditing = YES.

If someone tells me what is happening, it will be great :)

EDIT: Compiling from XCode6GM to my iPhone running iOS7.1 also gives me a circle. I suspect a bug with Xcode6gm?

Here is a screenshot with circles:

enter image description here

+6
source share
4 answers

I had this nasty problem when porting my application to iOS8.

Here is the workaround I found ... add something like this to your subclass of UITableViewCell:

 - (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; for( UIView* subview in self.subviews ) if( [NSStringFromClass(subview.class) isEqualToString:@"UITableViewCellEditControl"] ) subview.hidden = YES; } 

I hope this will be documented / fixed soon ...

+6
source

I think I have a better solution, add this code to your own uitableviewcell:

 - (void)addSubview:(UIView *)view { [super addSubview:view]; if( [NSStringFromClass(view.class) isEqualToString:@"UITableViewCellEditControl"] ) { view.hidden = YES } } 
+2
source

Here's a quick fix combining two answers:

 override func addSubview(view: UIView) { super.addSubview(view) if view.isKindOfClass(NSClassFromString("UITableViewCellEditControl")!) { view.hidden = true } } 
0
source

Here is the version of Swift3:

 override func addSubview(_ view: UIView) { super.addSubview(view) if view.classAsString() == "UITableViewCellEditControl" { view.isHidden = true } } 
0
source

Source: https://habr.com/ru/post/975174/


All Articles