Skip to content

Instantly share code, notes, and snippets.

@SarahAlsharif
Created September 13, 2020 01:48
Show Gist options
  • Save SarahAlsharif/6939816a2f86e0f2ff31a93e6a5e3346 to your computer and use it in GitHub Desktop.
Save SarahAlsharif/6939816a2f86e0f2ff31a93e6a5e3346 to your computer and use it in GitHub Desktop.
struct Container <Content : View> : View {
var content : Content
init(@ViewBuilder content: () -> Content) {
self.content = content()
}
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 20)
.foregroundColor(Color.blue.opacity(0.3))
VStack {
Spacer()
content
.font(.system(size: 20))
.foregroundColor(.secondary)
.padding()
Spacer()
Divider()
HStack {
Button(action: {
// action
}) {
Image(systemName: "hand.thumbsup")
}.frame(width: 150)
Divider()
Button(action: {
// action
}) {
Image(systemName: "hand.thumbsdown")
}
.frame(width: 150)
}
.font(.system(size: 20))
.frame(height: 50)
.padding()
}
}
.padding()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment