ios - Xcode (Swift) - How to store name of image file on button -


i trying name image file on uibutton. set image using

buttonname.setimage(uiimage(named:"bluepiece.png"), forstate: .normal) buttonname.setimage(uiimage(named:"redpiece.png"), forstate: .normal) 

and want able compare names of image files in "if statement". also, using swift , xcode 6.4.

complare images :

if(btn.imageview.image == uiimage(named:"bluepiece.png")){     //do stuff here } 

or can take 1 boolean variable - set true or false changing , comparing images.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -