I want retrieve non jpg/png files from the Asset Catalog in Xcode 7. I saw it was possible now to add any kind of data into to Asset Catalog.
So the way I was doing it was working before moving gif/video from Xcode project into the Assets Catalog
private struct WalkthroughVideo {
static let name = "tokyo"
static let type = "mp4"
}
private var moviePlayer : AVPlayerViewController? = {
guard let path = NSBundle.mainBundle().pathForResource(WalkthroughVideo.name, ofType: WalkthroughVideo.type) else {
return nil
}
let url = NSURL.fileURLWithPath(path)
let playerViewController = AVPlayerViewController()
playerViewController.player = AVPlayer(URL: url)
return playerViewController
}()
So now path is nil. It can't find the file. Is there a new way to retrieve dataset ?