mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• 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
29 lines
985 B
Swift
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)
|
|
}
|
|
}
|