Skip to content

Commit

Permalink
fix reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Sep 15, 2021
1 parent 81f2063 commit 3272b73
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public extension ViewRenderNode {
View()
}
func _makeView() -> Any {
if View.self is UIView.Type, let reuseKey = reuseKey {
return ReuseManager.shared.dequeue(identifier: reuseKey, makeView() as! UIView)
}
return makeView()
}
// MARK: AnyViewRenderNode
Expand All @@ -28,12 +31,3 @@ public extension ViewRenderNode {
return updateView(view)
}
}

public extension ViewRenderNode where View: UIView {
func _makeView() -> Any {
if let reuseKey = reuseKey {
return ReuseManager.shared.dequeue(identifier: reuseKey, makeView())
}
return makeView()
}
}

0 comments on commit 3272b73

Please sign in to comment.