Walter West
Walter West

Reputation: 859

How to delete or hide edit UIButton for UITableViewController

I add edit UIButton to UITableViewController

 self.navigationItem.leftBarButtonItem = self.editButtonItem()

But I can't to find method for delete or hide it, just disabled

self.navigationItem.leftBarButtonItem?.enabled=false

Upvotes: 0

Views: 68

Answers (2)

Abubakr Dar
Abubakr Dar

Reputation: 4078

Try doing this

self.tableView.setEditing(false, animated: true)

Upvotes: 0

Ashish Kakkad
Ashish Kakkad

Reputation: 23882

You can hide the navigation's leftbarButtonItem by

self.navigationItem.leftBarButtonItem = nil;

and again set it by your method

self.navigationItem.leftBarButtonItem = self.editButtonItem()

Upvotes: 1

Related Questions