Discussion 議論
For a Shape
that also conforms to the View
protocol, like Color
or Linear
, this default implementation of the body
property provides a visual representation for the shape style. As a result, you can use the shape style in a view hierarchy like any other view:
ZStack {
Color.cyan
Text("Hello!")
}
.frame(width: 200, height: 50)