title: Error "fatal error: unexpectedly found nil while unwrapping an Optional value" when a segue is fired
body: <p>I added a segue to my app and when I fire the segue the app crashes in the iPhone 5S simulator (In other simulators it crash before then because of code specific to the device. <a href="https://stackoverflow.com/questions/32444151/changing-the-position-of-uiimageviews-based-on-the-size-of-the-device">Here</a> is a link to the question), the message "fatal error: unexpectedly found nil while unwrapping an Optional value" gets printed to the console and the error <code>Thread 1: EXC_BAD_INSTRUCTION (code=EXC_1386_INVOP, subcode=0x0)</code> is displayed on the line initializing the array. I think the reason why is because I have an animation of <code>UIImageView</code>s that requires un-wrapping. Here is how I do it:</p>
  
  <pre><code>// dieImages are UIImageViews that I am animating then displaying a random image of a die
  
      let dieImages = [dieImage0, dieImage1, dieImage2, dieImage3, dieImage4, dieImage5, dieImage6, dieImage7]
  
  // Die animation
                  for die in dieImages {
                      die.animationImages = [  &lt;====== Error on this line
                          UIImage(named: "dicey-die2")!,
                          UIImage(named: "dicey-die6")!,
                          UIImage(named: "dicey-die1")!,
                          UIImage(named: "dicey-die4")!,
                          UIImage(named: "dicey-die3")!,
                          UIImage(named: "dicey-die5")!,
                          UIImage(named: "dicey-die3")!,
                          UIImage(named: "dicey-die1")!,
                          UIImage(named: "dicey-die6")!,
                          UIImage(named: "dicey-die3")!,
                          UIImage(named: "dicey-die5")!,
                          UIImage(named: "dicey-die2")!,
                          UIImage(named: "dicey-die4")!
                      ]
  
                  die.animationRepeatCount = 1
                  die.animationDuration = 1.0
              }
  </code></pre>
  
  <p>But segue is of type <code>AnyObject</code> so I think that is the reason un-wrapping doesn't work:</p>
  
  <pre><code>override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {}
  </code></pre>
  
  <p>How do I un-wrap the images safely, or not un-wrap at all when the segue is fired? I have seen the methods of using two question marks (but that causes the error of "could not find an overload for 'init' that accepts the supplied arguments") or an if statement, but I don't know how to implement that.</p>
  
  <h2>update</h2>
  
  <p>I tried this code and the same thing happens as before</p>
  
  <pre><code>        let image0 = UIImage(named: "dicey-die1")!
          let image1 = UIImage(named: "dicey-die2")!
          let image2 = UIImage(named: "dicey-die3")!
          let image3 = UIImage(named: "dicey-die4")!
          let image4 = UIImage(named: "dicey-die5")!
          let image5 = UIImage(named: "dicey-die6")!
  
          let dieImages = [dieImage0, dieImage1, dieImage2, dieImage3, dieImage4, dieImage5, dieImage6, dieImage7]
  
          for die in dieImages {
              die.animationImages = [
                  image1,
                  image5,
                  image0,
                  image3,
                  image2,
                  image4,
                  image2,
                  image0,
                  image5,
                  image2,
                  image4,
                  image1,
                  image2
              ]
  
              die.animationRepeatCount = 1
              die.animationDuration = 1.0
          }
  </code></pre>
  
  <h2>update 2</h2>
  
  <p>I created an array with all the images</p>
  
  <pre><code>let image0:[UIImage] = [ UIImage(named: "dicey-die2")!,
              UIImage(named: "dicey-die6")!,
              UIImage(named: "dicey-die1")!,
              UIImage(named: "dicey-die4")!,
              UIImage(named: "dicey-die3")!,
              UIImage(named: "dicey-die5")!,
              UIImage(named: "dicey-die3")!,
              UIImage(named: "dicey-die1")!,
              UIImage(named: "dicey-die6")!,
              UIImage(named: "dicey-die3")!,
              UIImage(named: "dicey-die5")!,
              UIImage(named: "dicey-die2")!,
              UIImage(named: "dicey-die3")!]
  </code></pre>
  
  <p>Then I used the array in my animation</p>
  
  <pre><code>for die in dieImages {
      die.animationImages = [
        image0
      ]
  </code></pre>
  
  <p>The app crash at the <code>AppDelegate</code> so I added an exception breakpoint and the crash happened on the animation array:</p>
  
  <pre><code>die.animationImages = [
  </code></pre>
  
  <p>And this message was printed to the console:</p>
  
  <pre><code>2015-09-08 07:23:05.192 Diced[80843:14927078] -[Swift._SwiftDeferredNSArray _isResizable]: unrecognized selector sent to instance 0x7fa738dd7460
  </code></pre>