Fix history search
This commit is contained in:
parent
3b691345d8
commit
235b9e8f43
@ -17,6 +17,7 @@ class RealmSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource
|
||||
private var sections: [DateSection<Item>] = []
|
||||
private var cellIdentifier: String
|
||||
private var filterPredicate: FilterPredicate<Item>?
|
||||
private let groupQueue = DispatchQueue(label: "group")
|
||||
|
||||
private let onSizeChanged: ((Int) -> Void)?
|
||||
|
||||
@ -94,13 +95,15 @@ class RealmSectionedDataSource<Item,Cell>: NSObject, UITableViewDataSource
|
||||
items = items.filter(predicate)
|
||||
}
|
||||
|
||||
DispatchQueue.global().async {
|
||||
self.groupQueue.async {
|
||||
let newSections = items.groupedByDate()
|
||||
let changeset = StagedChangeset(source: self.sections, target: newSections)
|
||||
// let changeset = StagedChangeset(source: self.sections, target: newSections)
|
||||
DispatchQueue.main.async {
|
||||
self.tv.reload(using: changeset, with: animated ? .fade : .none) { newSects in
|
||||
self.sections = newSects
|
||||
}
|
||||
self.sections = newSections
|
||||
self.tv.reloadData()
|
||||
// self.tv.reload(using: changeset, with: animated ? .fade : .none) { newSects in
|
||||
// self.sections = newSects
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user