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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -