I created a custom tableviewcell and redefine the method - (void) setEditing:(BOOL)editing animated:(BOOL)animated
to hide UISwitch for edit mode.
This is my code.
-(void) setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; if (animated==YES) { // With animation if (editing == NO) { // Editing stopped [UIView animateWithDuration:0.3 animations:^{ [self.alarmSwitch setAlpha:1.0]; }]; [self.alarmSwitch setEnabled:YES]; } else { // Editing started [UIView animateWithDuration:0.3 animations:^{ [self.alarmSwitch setAlpha:0.0]; }]; [self.alarmSwitch setEnabled:NO]; } } else { // Without animation // ................. } }
On ios 5.0, this worked. Starting with ios 5.1 and later, it again stopped showing alarmSwitch. Here are some screenshots.
1) EDIT MODE

2) AFTER EDITING (iOS 5.0)

3) AFTER EDITING (iOS 5.1 and later)

If I scroll up and then scroll down (to redraw the cell), the switch is displayed again. Does anyone know why this could happen? It is strange that in iOS 5.0 it worked like a charm, and now it does not work.
source share