         }
     }
 
-    func livePhotoWithImageURL(imageURL: NSURL, videoURL: NSURL) -> PHLivePhoto? {
+    func livePhotoWithImageURL(imageURL: NSURL, videoURL: NSURL) -> PHLivePhoto {
         let livePhoto = PHLivePhoto()
-        let initWithImageURLvideoURL = NSSelectorFromString("_initWithImageURL:videoURL:");
-        if (livePhoto.respondsToSelector(initWithImageURLvideoURL) == true) {
-            livePhoto.performSelector(initWithImageURLvideoURL, withObject:imageURL, withObject: videoURL)
-            return livePhoto
-        } else {
-            return nil
-        }
+        let initWithImageURLvideoURL = Selector("_initWithImageURL:videoURL:")
+        livePhoto.performSelector(initWithImageURLvideoURL, withObject:imageURL, withObject: videoURL)
+        return livePhoto
     }
 
     @IBAction func takePhoto(sender: UIBarButtonItem) {

class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
    @IBOutlet weak var livePhotoView: PHLivePhotoView! {
        didSet {
            if let url = NSBundle.mainBundle().URLForResource("video", withExtension: "m4v") {
                loadVideoWithVideoURL(url)
            }
        }
    }


    }

    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
        picker.dismissViewControllerAnimated(true) {
            if let url = info[UIImagePickerControllerMediaURL] as? NSURL {
                self.loadVideoWithVideoURL(url)
            }
        }
    }
