swift compare string to button title code example Example: swift compare string to button title if myButton.currentTitle == "myString" { // Do something }