ios - Using UIButton Text as Text Input - Swift -


hello have profilelbl variable below uibutton. want text of button input in database (parse). couldn't figured out. tried lots of things still getting error:

  @iboutlet weak var profilelbl: uibutton!    var notification = pfobject(classname: "notifications")          notification["actionreceivername"] = profilelbl.text /*not working*/       /*    tried     notification["actionreceivername"] = sender.profilelbl.text     notification["actionreceivername"] = profilelbl.title    */ 

you can easy that

if let button = profilelbl as? uibutton {     if let title = button.titleforstate(.normal) {         println(title)         notification["actionreceivername"] = title     } } 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -