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

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -