Files
Morgan Pretty 04cd5a5516 Fixed and cleaned up some attachment handling issues
• Added the ability to save audio and generic attachments
• Cleaned up a bunch of duplicate and custom image processing
• Removed a few cases where we would load image data when we only wanted metadata
• Removed SignalAttachment thumbnail loading logic (now goes via ImageDataManager)
• Removed the "GIF" badge from animated thumbnails (not needed anymore now that they animate)
• Fixed an issue where activity indicators weren't getting themed correctly
• Fixed an issue where WebP images may not load due to large resolutions
2025-08-14 12:53:46 +10:00

29 lines
985 B
Swift

// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
import UIKit
public class DocumentPickerHandler: NSObject, UIDocumentPickerDelegate {
private let didPickDocumentsAt: ((UIDocumentPickerViewController, [URL]) -> Void)?
private let wasCancelled: ((UIDocumentPickerViewController) -> Void)?
// MARK: - Initialization
public init(
didPickDocumentsAt: ((UIDocumentPickerViewController, [URL]) -> Void)? = nil,
wasCancelled: ((UIDocumentPickerViewController) -> Void)? = nil
) {
self.didPickDocumentsAt = didPickDocumentsAt
self.wasCancelled = wasCancelled
}
// MARK: - UIDocumentPickerDelegate
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
didPickDocumentsAt?(controller, urls)
}
public func documentPickerWasCancelled(_ controller: UIDocumentPickerViewController) {
wasCancelled?(controller)
}
}