Created
October 15, 2020 14:51
-
-
Save shaundon/4a7dcbda213efd7a4ee2e07322d637ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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