Skip to content

Instantly share code, notes, and snippets.

@shaundon
Created October 15, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaundon/4a7dcbda213efd7a4ee2e07322d637ec to your computer and use it in GitHub Desktop.
Save shaundon/4a7dcbda213efd7a4ee2e07322d637ec to your computer and use it in GitHub Desktop.
import SwiftUI
struct RoundedVStack<Content: View>: View {
let content: Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
VStack (spacing: 3.0) {
content
}
.cornerRadius(12.0)
.padding(.horizontal)
}
}
struct RoundedVStack_Previews: PreviewProvider {
static var previews: some View {
RoundedVStack {
Text("Foo")
.padding()
.background(Color.white)
Text("Bar")
.padding()
.background(Color.white)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment