-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Since makeImplicitRoot is supported via the recent multiView / dynamicView PR, I'm trying to unlock the new IDView implementation:
@available(OpenSwiftUI_v1_0, *)
extension IDView {
@usableFromInline
package static func _makeView(view: _GraphValue<Self>, inputs: _ViewInputs) -> _ViewOutputs {
if _SemanticFeature_v2.isEnabled {
return makeImplicitRoot(view: view, inputs: inputs)
} else {
let id = view.value[offset: { .of(&$0.id) }]
let phase = IDPhase(id: id, phase: inputs.viewPhase, lastID: nil, delta: 0)
var inputs = inputs
inputs.viewPhase = Attribute(phase)
return Content.makeDebuggableView(view: view[offset: { .of(&$0.content)}], inputs: inputs)
}
}
}But if it is enabled, no update will happen even we change the ID.
struct ContentView: View {
@State private var showRed = false
var body: some View {
Color(platformColor: showRed ? .red : .blue)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
showRed.toggle()
}
}
.id(showRed)
}
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working