ios - UITableViewController custom setEditing:animated: -


i overriding setediting:animated: method in uitableviewcontroller subclass , telling reload data when method called.

i using custom uitableviewcell subclass switched uilabel title uitextfield, initial user interaction disabled. when editing begins, reloading data tell cells enable user interaction people can change cell title.

it worked out pretty neatly except when called

- (void)setediting:(bool)editing animated:(bool)animated {     [super setediting:editing animated:animated];     [[self tableview] reloaddata]; } 

the editing animation gets cancelled out if passed no "animated" argument.

is there work around this?

you have no animation because calling reloaddata method. try code:

       - (void)setediting:(bool)editing animated:(bool)animated{          nsrange range = nsmakerange(0, [self numberofsectionsintableview:self.tableview]);         nsindexset *sections = [nsindexset indexsetwithindexesinrange:range];         [self.tableview reloadsections:sections withrowanimation:uitableviewrowanimationmiddle];              [super setediting:editing animated:animated];         } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -