Have the UserIndicatorController use a separate window, switch to using one single instance throughout the application

This commit is contained in:
Stefan Ceriu
2023-11-09 15:10:50 +02:00
committed by Stefan Ceriu
parent 1102beb3dd
commit 4b26a798dc
44 changed files with 210 additions and 221 deletions
@@ -29,10 +29,10 @@ enum PhotoLibraryPickerError: Error {
}
struct PhotoLibraryPicker: UIViewControllerRepresentable {
private weak var userIndicatorController: UserIndicatorControllerProtocol?
private let userIndicatorController: UserIndicatorControllerProtocol
private let callback: (PhotoLibraryPickerAction) -> Void
init(userIndicatorController: UserIndicatorControllerProtocol?, callback: @escaping (PhotoLibraryPickerAction) -> Void) {
init(userIndicatorController: UserIndicatorControllerProtocol, callback: @escaping (PhotoLibraryPickerAction) -> Void) {
self.userIndicatorController = userIndicatorController
self.callback = callback
}
@@ -73,9 +73,9 @@ struct PhotoLibraryPicker: UIViewControllerRepresentable {
picker.delegate = nil
photoLibraryPicker.userIndicatorController?.submitIndicator(UserIndicator(id: Self.loadingIndicatorIdentifier, type: .modal, title: L10n.commonLoading))
photoLibraryPicker.userIndicatorController.submitIndicator(UserIndicator(id: Self.loadingIndicatorIdentifier, type: .modal, title: L10n.commonLoading))
defer {
photoLibraryPicker.userIndicatorController?.retractIndicatorWithId(Self.loadingIndicatorIdentifier)
photoLibraryPicker.userIndicatorController.retractIndicatorWithId(Self.loadingIndicatorIdentifier)
}
provider.loadFileRepresentation(forTypeIdentifier: contentType.identifier) { [weak self] url, error in