我熟悉这段代码:self.navigationItem.leftBarButtonItem = self.editButtonItem。
看这段代码:
class ThirdViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
@IBOutlet var tblTasks: UITableView! // declaring this allows you to reload the tableView to update your items
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
Run Code Online (Sandbox Code Playgroud)
我有允许存在编辑按钮的代码,但在我的应用程序和情节提要中都看不到编辑按钮。
我是 Swift 初学者,如果有人能指出我正确的方向,那就太好了。