ios - How do I turn the text of a button to a variable in Swift? -


how turn text of button variable in swift? can come far, isn't working:

var answer = "example"  @ibaction func button1(sender: anyobject) {      var answer = button1.text } 

any appreciated. thanks!

to title of uibutton have reach child uilabel:

@ibaction func button1(sender: anyobject) {     let button = sender uibutton // as! swift 1.2     var answer = button.titlelabel!.text } 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -