Skip to content

Instantly share code, notes, and snippets.

@thepearl
Last active December 15, 2022 16:48
Show Gist options
  • Save thepearl/5c53b88a45863558d7ae629547b28a5c to your computer and use it in GitHub Desktop.
Save thepearl/5c53b88a45863558d7ae629547b28a5c to your computer and use it in GitHub Desktop.
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