Skip to content

Commit a0e2357

Browse files
committed
fix(video-export): add iOS 18 version check for export(to:as:isolation:)
1 parent f4b9dbe commit a0e2357

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

KYPhotoLibrary/Sources/Video/KYPhotoLibrary+VideoExport.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ extension KYPhotoLibrary {
100100
let outputURL: URL = try await exportOptions.prepareOutputURL(for: asset)
101101

102102
try Task.checkCancellation()
103-
try await session.export(to: outputURL, as: outputFileType)
103+
104+
if #available(iOS 18, *) {
105+
try await session.export(to: outputURL, as: outputFileType)
106+
} else {
107+
session.outputURL = outputURL
108+
session.outputFileType = outputFileType
109+
await session.export()
110+
}
104111

105112
KYPhotoLibraryLog("Export Session Completed")
106113
return outputURL

0 commit comments

Comments
 (0)