UIImage showing nil even after initialize it

时间:2015-04-23 05:43:48

标签: swift uiimage ios8.1

I declared a UIImage variable :

var s1:UIImage? = UIImage(named: "alphabet O")

I am assigning an another image in a method:

 func setImage(){

    if var img = s1{
    img = UIImage(named: "alphabet X")!
    }

}

The answer can be quite simple but truly I am very new in swift. Please help. Thanks

0 个答案:

没有答案