support for stored properties
struct CardView<Content: View>: View {
// 👇🏻 New in Swift 5.4
@ViewBuilder let content: Content
// ⭐️ Swift will synthesize the following (internal) initializer:
// ```
// internal init(@ViewBuilder content: () -> Content) {
// self.content = content()
// }
// ```
var body: some View {
content
}
}
Last updated
Was this helpful?