:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/AppleFilePicker.xml. .. _class_AppleFilePicker: AppleFilePicker =============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Provides access to the operating system file picker, on iOS, this provides access to sandboxed content. .. rst-class:: classref-introduction-group Description ----------- This class provides access to the system's native file picker (`UIDocumentPickerViewController` on iOS, `NSOpenPanel` on macOS). It allows selecting files based on UTTypes (passed as file extensions) and supports both single and multiple file selection. If your application is running in a sandbox (always the case on iOS, sometimes on MacOS), you need to call the AppleURL methods for starting and stopping access to them. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`pick_document`\ (\ allowed_types\: :ref:`Array`, allow_multiple\: :ref:`bool`\ ) | +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_AppleFilePicker_signal_canceled: .. rst-class:: classref-signal **canceled**\ (\ ) :ref:`🔗` Emitted when the picker is canceled by the user. .. rst-class:: classref-item-separator ---- .. _class_AppleFilePicker_signal_file_selected: .. rst-class:: classref-signal **file_selected**\ (\ url\: :ref:`AppleURL`, path\: :ref:`String`\ ) :ref:`🔗` Emitted when a single file is selected (when ``allow_multiple`` is false). .. rst-class:: classref-item-separator ---- .. _class_AppleFilePicker_signal_files_selected: .. rst-class:: classref-signal **files_selected**\ (\ urls\: :ref:`Array`, paths\: :ref:`PackedStringArray`\ ) :ref:`🔗` Emitted when multiple files are selected (when ``allow_multiple`` is true). .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_AppleFilePicker_method_pick_document: .. rst-class:: classref-method |void| **pick_document**\ (\ allowed_types\: :ref:`Array`, allow_multiple\: :ref:`bool`\ ) :ref:`🔗` Opens the file picker. \ ``allowed_types`` should be an array of strings representing the file extensions or UTTypes you want to allow (e.g. ``["txt", "png"]`` or ``["public.plain-text"]``). \ ``allow_multiple`` if true, allows selecting multiple files. Results will be emitted via the :ref:`files_selected` signal. If false (default), results are emitted via :ref:`file_selected`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`