Last active
August 19, 2020 12:48
-
-
Save sanzaru/9164f3ebf6b7a6c5fec7a327195f5e6c to your computer and use it in GitHub Desktop.
Demo view for collapsible view
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 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