Skip to content

Instantly share code, notes, and snippets.

@sanzaru
Last active August 19, 2020 12:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanzaru/9164f3ebf6b7a6c5fec7a327195f5e6c to your computer and use it in GitHub Desktop.
Save sanzaru/9164f3ebf6b7a6c5fec7a327195f5e6c to your computer and use it in GitHub Desktop.
Demo view for collapsible view
import SwiftUI
struct CollapsibleDemoView: View {
var body: some View {
VStack(spacing: 10) {
HStack {
Text("Here we have some fancy text content. Could be whatever you imagine.")
Spacer()
}
.padding(.bottom)
Divider()
.padding(.bottom)
Collapsible(
label: { Text("Collapsible") },
content: {
HStack {
Text("Content")
Spacer()
}
.frame(maxWidth: .infinity)
.padding()
.background(Color.secondary)
}
)
.frame(maxWidth: .infinity)
Spacer()
}
.padding()
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}
struct CollapsibleDemoView_Previews: PreviewProvider {
static var previews: some View {
CollapsibleDemoView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment