Access button text

Asked

Viewed 31 times

0

Everybody, good afternoon to you... I have the following, I need to know the title that is on a button , as if it were . text , to define use setTitle , but to know what the name ? Thank you

1 answer

1


To access the title of the button you must first access the UILabel, because the button title is a UILabel.

To access do as follows:

button.titleLabel!.text
  • In the log e; and Optionall ("text") appears for a possible comparison with if is not required by this ne ? ie I can do if(labelDoBt == "my button title ") ?

  • That, this "Optional" just says that the value is optional

  • thank you....

Browser other questions tagged

You are not signed in. Login or sign up in order to post.