diff --git a/Demo/FilestackDemo/ViewController.swift b/Demo/FilestackDemo/ViewController.swift index f64aeabd..aadbe5dd 100644 --- a/Demo/FilestackDemo/ViewController.swift +++ b/Demo/FilestackDemo/ViewController.swift @@ -101,4 +101,9 @@ extension ViewController: PickerNavigationControllerDelegate { func pickerReportedUploadProgress(picker: PickerNavigationController, progress: Float) { print("Picker \(picker) reported upload progress: \(progress)") } + + /// Called after the picker was dismissed. + func pickerWasDismissed(picker: PickerNavigationController) { + print("Picker \(picker) was dismissed.") + } } diff --git a/Sources/Filestack/UI/Public/Controllers/PickerNavigationController.swift b/Sources/Filestack/UI/Public/Controllers/PickerNavigationController.swift index 48d0b371..08014d88 100644 --- a/Sources/Filestack/UI/Public/Controllers/PickerNavigationController.swift +++ b/Sources/Filestack/UI/Public/Controllers/PickerNavigationController.swift @@ -25,6 +25,10 @@ import UIKit /// The picker delegate. Optional @objc public weak var pickerDelegate: PickerNavigationControllerDelegate? + + deinit { + pickerDelegate?.pickerWasDismissed?(picker: self) + } } /// This protocol contains the function signatures any `PickerNavigationController` delegate should conform to. @@ -40,6 +44,9 @@ import UIKit /// Called when the picker reports progress during a file or set of files being uploaded. @objc optional func pickerReportedUploadProgress(picker: PickerNavigationController, progress: Float) + + /// Called after the picker was dismissed. + @objc optional func pickerWasDismissed(picker: PickerNavigationController) } extension PickerNavigationController: StylizerDelegate {