DocumentPickerCoordinator

public final class DocumentPickerCoordinator : NSObject
extension DocumentPickerCoordinator: UIDocumentPickerDelegate
extension DocumentPickerCoordinator: UIDropInteractionDelegate

Undocumented

  • The object that acts as the delegate of the document picker coordinator.

    Declaration

    Swift

    public weak var delegate: DocumentPickerCoordinatorDelegate?
  • Used to filter out PDFs when there are already imported images.

    Declaration

    Swift

    public var isPDFSelectionAllowed: Bool
  • Once the user has selected one or several documents from a picker, this has to be dismissed. Files explorer dismissal is handled by the OS and drag and drop does not need to be dismissed. However, the Gallery picker should be dismissed once the images has been imported.

    It is also used to check if the currentPickerViewController is still present so an error dialog can be shown fro there

    Declaration

    Swift

    private(set) public var currentPickerDismissesAutomatically: Bool { get }
  • The current picker UIViewController. Used to show an error after validating picked documents.

    Declaration

    Swift

    private(set) public var currentPickerViewController: UIViewController? { get }
  • Indicates if the user granted access to the gallery before. Used to start caching images before showing the Gallery picker.

    Declaration

    Swift

    public var isGalleryPermissionGranted: Bool { get }
  • Designated initializer for the DocumentPickerCoordinator.

    Declaration

    Swift

    public init(giniConfiguration: GiniConfiguration)

    Parameters

    giniConfiguration

    GiniConfiguration use to configure the pickers.

  • Starts caching gallery images. Gallery permissions should have been granted before using it.

    Declaration

    Swift

    public func startCaching()
  • Set up the drag and drop feature in a view.

    Note

    Only available in iOS >= 11

    Declaration

    Swift

    @available(iOS 11.0, *)
    public func setupDragAndDrop(in view: UIView)

    Parameters

    view

    View that will handle the drop interaction.

  • Shows the Gallery picker from a given viewController

    Declaration

    Swift

    public func showGalleryPicker(from viewController: UIViewController)

    Parameters

    viewController

    View controller which presentes the gallery picker

  • Shows the File explorer picker from a given viewController

    Declaration

    Swift

    public func showDocumentPicker(from viewController: UIViewController,
                                   device: UIDevice = UIDevice.current)

    Parameters

    viewController

    View controller which presentes the gallery picker

  • Declaration

    Swift

    public func dismissCurrentPicker(completion: @escaping () -> Void)

    Parameters

    completion

    Completion block executed once the picker is dismissed

  • Undocumented

    Declaration

    Swift

    public func dropInteraction(_ interaction: UIDropInteraction, canHandle session: UIDropSession) -> Bool
  • Undocumented

    Declaration

    Swift

    public func dropInteraction(_ interaction: UIDropInteraction,
                                sessionDidUpdate session: UIDropSession) -> UIDropProposal
  • Undocumented

    Declaration

    Swift

    public func dropInteraction(_ interaction: UIDropInteraction, performDrop session: UIDropSession)