Created
September 13, 2020 18:10
-
-
Save mluton/c70bac24d6d01db06c93b8d0857dd0f7 to your computer and use it in GitHub Desktop.
SwiftUI - List In Popover
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
struct ContentView: View { | |
@State private var showPopover: Bool = false | |
var body: some View { | |
Button(action: { | |
self.showPopover = true | |
}) { | |
Text("Albums") | |
}.popover(isPresented: $showPopover) { | |
ScrollView(.vertical, showsIndicators: true) { | |
VStack(alignment: .leading) { | |
HStack { | |
Text("Dark Side of the Moon") | |
Image(systemName: "checkmark") | |
} | |
Divider() | |
Text("Wish You Were Here") | |
Divider() | |
Text("Animals") | |
Divider() | |
Text("The Wall") | |
} | |
.padding() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment