Update API

This commit is contained in:
Ilya Laktyushin
2024-12-23 22:02:31 +04:00
parent d92c751b6f
commit 292798a494
29 changed files with 14730 additions and 13040 deletions

View File

@@ -2778,18 +2778,18 @@ final class MediaPickerContext: AttachmentMediaPickerContext {
private weak var controller: MediaPickerScreenImpl?
var selectionCount: Signal<Int, NoError> {
//if self.controller?.forCollage == true {
if self.controller?.forCollage == true {
return .single(0)
// } else {
// return Signal { [weak self] subscriber in
// let disposable = self?.controller?.interaction?.selectionState?.selectionChangedSignal().start(next: { [weak self] value in
// subscriber.putNext(Int(self?.controller?.interaction?.selectionState?.count() ?? 0))
// }, error: { _ in }, completed: { })
// return ActionDisposable {
// disposable?.dispose()
// }
// }
// }
} else {
return Signal { [weak self] subscriber in
let disposable = self?.controller?.interaction?.selectionState?.selectionChangedSignal().start(next: { [weak self] value in
subscriber.putNext(Int(self?.controller?.interaction?.selectionState?.count() ?? 0))
}, error: { _ in }, completed: { })
return ActionDisposable {
disposable?.dispose()
}
}
}
}
var caption: Signal<NSAttributedString?, NoError> {