Skip to main content
0 votes
1 answer
142 views

swiftui fileimporter inside UIHostingController

I'm working on an old iOS app that started with objective-C + UIKit and has being migrated to Swift + SwiftUI. Currently its code is mostly Swift + SwiftUI but it has still some objective-C and some ...
Wonton's user avatar
  • 1,143
1 vote
0 answers
63 views

How to open and display different files in WindowGroup windows (tabs) using fileImporter from CommandGroup on the WindowGroup?

In code below the @State var modelData initializes with empty structures, and in that case the ContentView shows nothing. (This is fine.) The modelData can also initialize from a file obtained from ...
TT--'s user avatar
  • 3,288
1 vote
1 answer
605 views

SwiftUI .fileImporter Not Working Due to Permissions

In an iOS app, I am trying to load a .csv file from the user iCloud Drive. It works as expected in the simulator but does not work on a device. I have seen a couple of SO articles with similar ...
JohnSF's user avatar
  • 4,410
0 votes
1 answer
78 views

SwiftUI .fileImporter with Uniform Type Identifier throws error

I am attempting to make a simple .fileImporter to work for a file where I define my own Uniform Type Identifier. For some reason, when I want to upload a file, I always receive the error keyNotFound(...
Pete's user avatar
  • 213
0 votes
2 answers
544 views

Selecting default directory for .fileImporter on SwiftUI

Does anybody knows how to define default selected folder for using with .fileImporter modifier on SwiftUI? UIKit UIDocumentPickerViewController has the parameter directoryURL for this: https://...
arroyot24's user avatar
  • 189
1 vote
1 answer
273 views

SwiftUI: fileImporter crashes application from Commands menu

I've found very interesting behavior. So, here is a view with a button to open the file importer. If it is put in any view, it will work fine without issue. However, if it is put into the commands, ...
Kirill Rud's user avatar
2 votes
0 answers
261 views

SwiftUI file importer without buttons

I'm making some maintenance on my iOS app with SwiftUI. One feature of this app is open the Files app (using fileimporter) to select a file, import it and make some analysis to it. This has been ...
Wonton's user avatar
  • 1,143
1 vote
1 answer
698 views

SwiftUI `fileImporter` ViewModifier not working on iOS 15

I'm seeing some weird behaviour with the fileImporter modifier on my iOS app. When running this View code on an iPhone running iOS >= 16, it runs fine, the document picker presents itself and ...
Brandon Stillitano's user avatar
2 votes
0 answers
535 views

FileImporter SwiftUI

I m experiencing something weird with my File Importer in SwiftUI. Here is the code I´m using to invoke the file importer : .fileImporter(isPresented: $showFilePicker, allowedContentTypes: [.data], ...
Daniel Jorge's user avatar
1 vote
1 answer
1k views

Using fileImporter to import cloud folders

I'm using fileImporter to let the user select a folder: .fileImporter( isPresented: viewStore.binding(\.$fileImporterPresented), allowedContentTypes: [.folder], allowsMultipleSelection: ...
Dominik's user avatar
  • 766
1 vote
0 answers
139 views

FileImporter missing Select option

This is driving me crazy for many days now. I am trying to use the .fileImport() modifier in SwiftUI and apparently I am missing something VERY obvious but for the life of me I cannot find a way to ...
gm_'s user avatar
  • 129
2 votes
0 answers
547 views

Swift fileImporter size limiting

So i currently have this code: .fileImporter(isPresented: .constant(true), allowedContentTypes: [.pdf]) { result in switch result { case .success(let url): if url....
Vollan's user avatar
  • 1,898
2 votes
2 answers
3k views

SwiftUI cannot read data of Document using .fileImporter - Error Domain=NSCocoaErrorDomain Code=257

Trying to read data of document using following code block .fileImporter(isPresented: $showDocPicker, allowedContentTypes: [SupportDocTypes], onCompletion: { result in do { let fileURL = ...
Dilan's user avatar
  • 2,718
4 votes
3 answers
2k views

SwiftUI .fileImporter cannot show again after dismissing by swipe down

I am using the .fileImporter modifier in SwiftUI to import pdf files in my app. I'm having a few issues. Firstly the data is slow to load and often it doesn't load and gives message Internal Error ...
alionthego's user avatar