mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Attachment menu improvements
This commit is contained in:
@@ -4,6 +4,7 @@ import Photos
|
||||
import SwiftSignalKit
|
||||
|
||||
private let imageManager = PHCachingImageManager()
|
||||
private let assetsQueue = Queue()
|
||||
|
||||
func assetImage(fetchResult: PHFetchResult<PHAsset>, index: Int, targetSize: CGSize, exact: Bool) -> Signal<UIImage?, NoError> {
|
||||
let asset = fetchResult[index]
|
||||
@@ -36,9 +37,11 @@ func assetImage(asset: PHAsset, targetSize: CGSize, exact: Bool) -> Signal<UIIma
|
||||
}
|
||||
}
|
||||
return ActionDisposable {
|
||||
imageManager.cancelImageRequest(token)
|
||||
assetsQueue.async {
|
||||
imageManager.cancelImageRequest(token)
|
||||
}
|
||||
}
|
||||
}
|
||||
} |> runOn(assetsQueue)
|
||||
}
|
||||
|
||||
func assetVideo(fetchResult: PHFetchResult<PHAsset>, index: Int) -> Signal<AVAsset?, NoError> {
|
||||
|
||||
Reference in New Issue
Block a user