I am building an app in Swift on Xcode 7.2
I added a video to my ViewController. Here\'s the code:
import UIKit
import AVKit
import AVFoundation
class G
Because your path you was using is from simulator, on real device it changed. if you added this file to your project, you can get this url via:
func getDocumentsURL() -> NSURL {
let documentsURL = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0]
return documentsURL
}
func fileInDocumentsDirectory(filename: String) -> String {
let fileURL = getDocumentsURL().URLByAppendingPathComponent(filename)
return fileURL.path!
}