swift - UIImage showing nil even after initialize it -


i declared uiimage variable :

var s1:uiimage? = uiimage(named: "alphabet o") 

i assigning image in method:

 func setimage(){      if var img = s1{     img = uiimage(named: "alphabet x")!     }  } 

the answer can quite simple new in swift. please help. thanks


Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

jquery - jqGrid update specific column data with out refreshing the entire column? -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -