Poll UI improvements

This commit is contained in:
Ali
2020-01-12 22:07:37 +04:00
parent 0e792f0502
commit 2a6f1f811b
13 changed files with 196 additions and 59 deletions

View File

@@ -197,12 +197,12 @@ open class ItemListController: ViewController, KeyShortcutResponder, Presentable
public var willScrollToTop: (() -> Void)?
public func setReorderEntry<T: ItemListNodeEntry>(_ f: @escaping (Int, Int, [T]) -> Void) {
public func setReorderEntry<T: ItemListNodeEntry>(_ f: @escaping (Int, Int, [T]) -> Signal<Bool, NoError>) {
self.reorderEntry = { a, b, list in
f(a, b, list.map { $0 as! T })
return f(a, b, list.map { $0 as! T })
}
}
private var reorderEntry: ((Int, Int, [ItemListNodeAnyEntry]) -> Void)? {
private var reorderEntry: ((Int, Int, [ItemListNodeAnyEntry]) -> Signal<Bool, NoError>)? {
didSet {
if self.isNodeLoaded {
(self.displayNode as! ItemListControllerNode).reorderEntry = self.reorderEntry