Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created August 29, 2022 21:21
Show Gist options
  • Select an option

  • Save sturdysturge/faa1222202d6270a3792c813f24cf323 to your computer and use it in GitHub Desktop.

Select an option

Save sturdysturge/faa1222202d6270a3792c813f24cf323 to your computer and use it in GitHub Desktop.
import SwiftUI
@available(iOS 16.0, *)
extension ContentView: View {
var picker: some View {
Picker("", selection: $alignment) {
ForEach(HorizontalAlignment.allCases) { alignment in
Text(alignment.name)
.tag(alignment)
}
}
}
var body: some View {
VStack {
picker
grid
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment