Polish debug tree output for state properties

This commit is contained in:
david-swift 2024-06-21 07:25:51 +02:00
parent c7f37e0c1c
commit 1d7c80f5e7
2 changed files with 6 additions and 3 deletions

View File

@ -18,7 +18,7 @@ public struct StateWrapper: ConvenienceWidget {
/// The debug tree parameters. /// The debug tree parameters.
public var debugTreeParameters: [(String, value: CustomStringConvertible)] { public var debugTreeParameters: [(String, value: CustomStringConvertible)] {
[ [
("state", value: state) ("state", value: state.map { $0.key.dropFirst() }.joined(separator: ", "))
] ]
} }

View File

@ -1,12 +1,15 @@
import Meta import Meta
import SampleBackends import SampleBackends
struct DemoView: SimpleView { struct DemoView: View {
@State private var test = ""
var view: Body { var view: Body {
Wrapper { Wrapper {
Backend1.TestWidget1() Backend1.TestWidget1()
Backend1.Button("") { Backend1.Button(test) {
test = "\(Int.random(in: 0...10))"
} }
TestView() TestView()
testContent testContent