Skip to content

Commit

Permalink
Create iOS temp file in documents file picker (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedRejeb authored May 29, 2024
1 parent 6f16e0d commit fbae861
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private fun rememberDocumentPickerLauncher(
controller: UIDocumentPickerViewController,
didPickDocumentAtURL: NSURL,
) {
onResult(listOf(KmpFile(didPickDocumentAtURL)))
onResult(listOfNotNull(didPickDocumentAtURL.createTempFile()?.let(::KmpFile)))
}

override fun documentPicker(
Expand All @@ -66,7 +66,7 @@ private fun rememberDocumentPickerLauncher(
) {
val dataList =
didPickDocumentsAtURLs.mapNotNull {
(it as? NSURL)?.let(::KmpFile)
(it as? NSURL)?.createTempFile()?.let(::KmpFile)
}
coroutineScope.launch {
withContext(Dispatchers.Main) {
Expand Down

0 comments on commit fbae861

Please sign in to comment.