jeudi 7 juillet 2016

How to stop redirecting to another view when multiple select mode is on


I use the multiple select feature of UITableView, whenever I click the rows, it shows the detail view of that row. I also set allowsSelection to false but it doesn't affect. Here is my code and could anybody suggest on this case?

@IBAction func onEmailButtonPressed(sender: AnyObject) {
        let isSend = (emailButton.title != "Cancel")

        if isSend {
            emailButton.image = nil
            emailButton.title = "Cancel"
        } else {
            emailButton.title = ""
            emailButton.image = UIImage(named: "email_white")
        }

        self.tableView.allowsMultipleSelection = isSend
        self.tableView.allowsMultipleSelectionDuringEditing = isSend
        self.tableView.allowsSelection = !isSend
        self.tableView.setEditing(isSend, animated: false)

        contactAgentBottomButton.hidden = !isSend
        self.navigationItem.leftBarButtonItem?.enabled = !isSend

    }

Aucun commentaire:

Enregistrer un commentaire