xcode 7 image array allocation

44 views Asked by At

How do I put multiple images in an empty image array in swift 2 or Xcode 7.3?

The following error keeps popping up for me:

cannot assign a value of type 'UIImage?' to type '[UIImage]'

enter image description here

1

There are 1 answers

0
Kathiresan Murugan On BEST ANSWER

Try like this:

imageArray = [UIImage(named: "1"), UIImage(named: "2")]