Open UITableView edit action buttons programmatically

前端 未结 5 2009
忘掉有多难
忘掉有多难 2020-11-29 03:54

I have a UIPageViewController that have UITableViewControllers inside it, and the swipe left gestures are conflicted between the UIPageViewCo

5条回答
  •  春和景丽
    2020-11-29 04:31

    On your button click event, could you please try with below function.

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

    This is function is in the swift syntax.

    As per the Apple developer support website it will do the following things,

    When you call this method with the value of editing set to true, and the UITableViewCell object is configured to have controls, the cell shows an insertion (green plus) or deletion control (red minus) on the left side of each cell and a reordering control on the right side. This method is called on each visible cell when the setEditing:animated: method of UITableView is invoked. Calling this method with editing set to false removes the controls from the cell.

    Hope this answers the question.

提交回复
热议问题