ios - change UIButton text with another UIButton text (swift) -


my question how change uibutton's title uibutton's title. have 3 buttons , want exchange title button 1 , 3 each other when click on button 2.

look @ image , understand.

how can that?

image

i think it's simple.

just preserve 1 of text button in string , replace clicking on button.

let title1 = btn1.titlelabel!.text  btn1.settitle(btn2.titlelabel!.text, forstate: uicontrolstate.normal) btn2.settitle(title1, forstate: uicontrolstate.normal) 

enter image description here

learn , apply code! hope helps you.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -