Because of UI elements, I created View Controller with a TableView inside. But I can't enable editing mode. I tried several methods without Solution. But with using TableView Controller there are no problems.
What I tried:
override func viewDidLoad() {
self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
override func setEditing(editing: Bool, animated: Bool) {
super.setEditing(editing, animated: animated)
}
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
if (editingStyle == UITableViewCellEditingStyle.Delete) {
// Action to delete data
}
}
Where can be the problem?