FileSelectorView

public struct FileSelectorView : View

A view which allows the user to select a file

If a file is selected it shows the file name as well as a button to change the file. If no file is selected, it shows a text asking the user to select a file, as well as a button.

  • the view

    Declaration

    Swift

    public var body: some View { get }
  • Creates the view

    Declaration

    Swift

    public init(allowedFileTypes: [String], url: Binding<URL?>)

    Parameters

    allowedFileTypes

    Array of Strings with the allowed file types (e.g. txt) - Without leading dot

    url

    Binding of the URL of the selected file