I am trying to figure out how to translate this in Swift and I am also having this error: \"Could not find an overload for “init” that accepts the supplied arguments\". Any
Unwrap those optionals. A UIImage is not the same as a UIImage?, which is what the named: initializer returns. Thus:
named:
var pageImages = [UIImage(named: "example.png")!, UIImage(named: "example2.png")!]
(Unless, of course, you actually want an array of optional UIImages.)