Search code examples
swiftvideocameravideo-recording

didStartRecordingToOutputFileAtURL not being called in swift 2.0


Camera Manager

Hello,

The link above is an open source library to capture image and record a video. this library was working perfectly in swift 1.2 but when they update it to swift 2.0 i couldn't recored a video so i looked around and found out that didStartRecordingToOutputFileAtURL protocol is not being called at all !!

please help me !!


Solution

  • private var tempFilePath: NSURL = { let tempPath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("tempMovie").URLByAppendingP‌​athExtension("mp4"); if NSFileManager.defaultManager().fileExistsAtPath(tempPath.absoluteString) { do { try NSFileManager.defaultManager().removeItemAtPath(tempPath.absoluteString) } catch { } } return tempPath }()