title: Memory issue when using large UIImage array causes crashing (swift)
body: <p>In my app, I have an image array which holds all the images taken on my camera.  I am using a collectionView to display these images. However, when this image array reaches the 20th or so image, it crashes.  I believe this is due to a memory issue..  How do I store the images in an image array in a way which is memory efficient?</p>
  
  <p>Michael Dauterman provided an answer using thumbnail images.  I was hoping there was a solution besides this.  Maybe storing the pictures into NSData or CoreData?  </p>
  
  <p>Camera.swift:</p>
  
  <pre><code>//What happens after the picture is chosen
  func imagePickerController(picker:UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject:AnyObject]){
      //cast image as a string
      let mediaType = info[UIImagePickerControllerMediaType] as! NSString
      self.dismissViewControllerAnimated(true, completion: nil)
      //if the mediaType it actually is an image (jpeg)
      if mediaType.isEqualToString(kUTTypeImage as NSString as String){
          let image = info[UIImagePickerControllerOriginalImage] as! UIImage
  
          //Our outlet for imageview
          appraisalPic.image = image
  
          //Picture taken, to be added to imageArray
          globalPic = image
  
          //image:didFinish.. if we arent able to save, pass to contextInfo in Error Handling
          if (newMedia == true){
              UIImageWriteToSavedPhotosAlbum(image, self, "image:didFinishSavingWithError:contextInfo:", nil)
  
          }
      }
  }
  </code></pre>
  
  <p>NewRecord.swift</p>
  
  <pre><code>var imageArray:[UIImage] = [UIImage]()
  viewDidLoad(){
  
      //OUR IMAGE ARRAY WHICH HOLDS OUR PHOTOS, CRASHES AROUND 20th PHOTO ADDED
      imageArray.append(globalPic)
  
  //Rest of NewRecord.swift is code which adds images from imageArray to be presented on a collection view
  }
  </code></pre>