Skip to content

Instantly share code, notes, and snippets.

@mluton
Created September 13, 2020 18:10
Show Gist options
  • Save mluton/c70bac24d6d01db06c93b8d0857dd0f7 to your computer and use it in GitHub Desktop.
Save mluton/c70bac24d6d01db06c93b8d0857dd0f7 to your computer and use it in GitHub Desktop.
SwiftUI - List In Popover
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