Contents

setEditing(_:animated:)

Sets whether the view controller shows an editable view.

Declaration

func setEditing(_ editing: Bool, animated: Bool)

Parameters

  • editing:

    If True, the view controller should display an editable view; otherwise, False.

    If True and one of the custom views of the Navigationitem property is set to the value returned by the Editbuttonitem method, the associated navigation controller displays a Done button; otherwise, an Edit button.

  • animated:

    If True, animates the transition; otherwise, does not.

Discussion

Subclasses that use an edit-done button must override this method to change their view to an editable state if isEditing is true and a non-editable state if it is false. This method should invoke super’s implementation before updating its view.

See Also

Adding editing behaviors to your view controller