UITableView Edit mode

后端 未结 5 997
逝去的感伤
逝去的感伤 2020-12-24 05:13

I have UITableView and I am trying to load it by default in edit mode. The problem is when I this line table.editing=TRUE; my rows disappear, I im

5条回答
  •  星月不相逢
    2020-12-24 05:43

    To load a tableView in edit mode you should call setEditing(true, animated: false) in viewDidLoad().

    If your view controller is a subclass of UITableViewController there's no need to change, just make the above call. Otherwise if your view controller is a subclass of UIViewController, then you should make a call in this way: tableView.setEditing(true, animated: true).

    Tested with Swift 2.2.

提交回复
热议问题