swift - Cannot assign a value of type '[UIImage?]' to a value of type '[AnyObject]?' -
this code please help, i'm following tutorial can't figure out whats wrong. please help.
i'm trying create slideshow in swift
var logoimages: [uiimage] = [] logoimages.append(uiimage(named: "logo.png")!) imageview.animationimages = [ uiimage(named: "jade2.jpg"), uiimage(named: "jade1.jpg"), uiimage(named: "jade14.png") ] imageview.animationduration = 5 imageview.startanimating()
i thankful help.
your images optional in animationimages
add !
after every images , work fine.
and code be:
imageview.animationimages = [uiimage(named: "jade2.jpg")!, uiimage(named: "jade1.jpg")!, uiimage(named: "jade14.png")! ]
Comments
Post a Comment