mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat(ios): update dependencies to track upstream repository (#11143)
This commit is contained in:
@@ -10,11 +10,20 @@ import UIKit
|
||||
|
||||
extension UIView {
|
||||
func diffableUpdate(reusingViews blockViews: inout [BlockView], manifests: [AnyBlockManifest]) {
|
||||
defer {
|
||||
assert(blockViews.count == manifests.count, "blockViews count must match manifests count")
|
||||
}
|
||||
var shouldRemovedIndices: [Int] = []
|
||||
defer {
|
||||
shouldRemovedIndices.sorted(by: >).forEach { index in
|
||||
blockViews.remove(at: index)
|
||||
}
|
||||
}
|
||||
for idx in 0 ..< max(blockViews.count, manifests.count) {
|
||||
guard let manifest = manifests[safe: idx] else {
|
||||
if let view = blockViews[safe: idx] {
|
||||
view.removeFromSuperview()
|
||||
blockViews.remove(at: idx)
|
||||
shouldRemovedIndices.append(idx)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ public class MarkdownView: UIView {
|
||||
)
|
||||
anchorY = view.frame.maxY + theme.spacings.final
|
||||
}
|
||||
height = blockViews.map(\.frame.maxY).max() ?? 0
|
||||
assert(subviews.count == blockViews.count)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user