Created
July 2, 2021 02:28
-
-
Save mattyoung/c8ecad1d5b572a6d22e2a4f497dee674 to your computer and use it in GitHub Desktop.
This file contains 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 ContentView: View { | |
@State private var show = false | |
var body: some View { | |
// DisclosureGroup doesn't work here, works in `List` | |
VStack { | |
#warning("doesn't show content on expand at all") | |
DisclosureGroup { | |
Text("Content") | |
} label: { | |
Text("Label") | |
} | |
#warning("only show content in Xcode preview, doesn't show in sim or device") | |
DisclosureGroup(isExpanded: $show) { | |
Text("Content") | |
} label: { | |
Text("Label") | |
} | |
} | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment