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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -