Skip to content

Instantly share code, notes, and snippets.

@danielctull
Last active January 17, 2016 12:00
Show Gist options
  • Save danielctull/d73daab0fd47ca20b2b6 to your computer and use it in GitHub Desktop.
Save danielctull/d73daab0fd47ca20b2b6 to your computer and use it in GitHub Desktop.
var images: [UIImage] = []
for i in 0...9 {
guard let image = UIImage(named: "Loading \(i)") else {
continue
}
images.append(image)
}
let images = (0...9).map { UIImage(named: "Loading \($0)")! }
let images = (0...9).map { UIImage(named: "Loading \($0)") }.filter { $0 != nil }.map { $0! }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment