lundi 2 avril 2018

When UIButton is selected a white box appears over text label

i have a button that when selected, a white box appears over the title text of the button. I dont want this white box to appear. See images. button state unselected button state selected

The code controlling this is below...

@IBAction func backButtonPressed(_ sender: Any) {
        if let button = sender as? UIButton {
            if button.isSelected {
                createWorkoutButton.isEnabled = false
                backButton.backgroundColor = #colorLiteral
                backButtonPressed = false
                backButton.isSelected = false
            } else {
                createWorkoutButton.isEnabled = true
                backButton.backgroundColor = #colorLiteral
                backButtonPressed = true
                backButton.isSelected = true
            }
        }
    }

Aucun commentaire:

Enregistrer un commentaire