Last active
December 15, 2022 16:48
-
-
Save thepearl/5c53b88a45863558d7ae629547b28a5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct VStack<Content: View>: View { | |
let content: () -> Content | |
init(@ViewBuilder content: @escaping () -> Content) { | |
self.content = content | |
} | |
var body: some View { | |
// Create and arrange the subviews in a vertical stack. | |
content() | |
} | |
} | |
// Call VStack | |
VStack { | |
Text("Hello") | |
Text("World") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment