|
@@ -37,8 +37,10 @@ class NCMainMenuTableViewController: UITableViewController {
|
|
|
|
|
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
let menuAction = actions[indexPath.row]
|
|
let menuAction = actions[indexPath.row]
|
|
- self.dismiss(animated: true, completion: nil)
|
|
|
|
- menuAction.action?(menuAction)
|
|
|
|
|
|
+ if let action = menuAction.action {
|
|
|
|
+ self.dismiss(animated: true, completion: nil)
|
|
|
|
+ action(menuAction)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: - Table view data source
|
|
// MARK: - Table view data source
|
|
@@ -58,6 +60,10 @@ class NCMainMenuTableViewController: UITableViewController {
|
|
let actionIconView = cell.viewWithTag(1) as! UIImageView
|
|
let actionIconView = cell.viewWithTag(1) as! UIImageView
|
|
let actionNameLabel = cell.viewWithTag(2) as! UILabel
|
|
let actionNameLabel = cell.viewWithTag(2) as! UILabel
|
|
|
|
|
|
|
|
+ if action.action == nil {
|
|
|
|
+ cell.selectionStyle = .none
|
|
|
|
+ }
|
|
|
|
+
|
|
if (action.isOn) {
|
|
if (action.isOn) {
|
|
actionIconView.image = action.onIcon
|
|
actionIconView.image = action.onIcon
|
|
actionNameLabel.text = action.onTitle
|
|
actionNameLabel.text = action.onTitle
|