Last active
September 29, 2016 23:52
-
-
Save lostincode/d303434212c784ce0f91cd8327b9a00b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: get the 'AVComposition asset' first ;) | |
let uuid = UUID().uuidString | |
let exportPath = NSTemporaryDirectory().appendingFormat("\(uuid).mov") | |
let exportUrl = URL(fileURLWithPath: exportPath) | |
let exporter = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetHighestQuality) | |
exporter?.shouldOptimizeForNetworkUse = true | |
exporter?.outputURL = exportUrl | |
exporter?.outputFileType = AVFileTypeQuickTimeMovie | |
exporter?.exportAsynchronously(completionHandler: { | |
if exporter?.status == .completed { | |
let url = exporter?.outputURL | |
DispatchQueue.main.async { | |
//ayy | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment