Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

SwiftUI - FileImporter allow extension .sqlite3

Hi,


my app use the fileimporter and fileexporter to transfer data. The export process works.


But my app is not able to pick the files with the extension "sqlite3". They are grayed out. See screenshot. Not able to pick.


What I have to do to allow my app to use the extension "sqlite3"?



Many thanks in advance.


Sven

Posted on Mar 7, 2022 2:38 PM

Reply
Question marked as Best reply

Posted on Mar 7, 2022 7:33 PM

Show your code that calls the file importer.


The .fileImporter modifier has an allowedContentTypes argument, which lists the file types that can be imported. You must include .sqlite3 in the array of allowed content types.


Similar questions

2 replies

Mar 8, 2022 7:32 AM in response to Mark Szymczyk

Oh man. Thanks a million. I have completely overlooked that and was looking on a completely wrong corner.


Thank you so much for your answer.


Here are my code

.fileImporter(
    isPresented: $showFileImporter,
    allowedContentTypes: [UTType.init(filenameExtension: "sqlite3")!],
    allowsMultipleSelection: false
) { result in
...
}

SwiftUI - FileImporter allow extension .sqlite3

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.