Swift Dev Notes
Ctrlk
SedatOnat.devAffiliated with SedatOnat.com
  • 👋Welcome to SedatOnat.dev
  • Learning Path
    • What to Learn?
    • How to Learn?
    • Useful Docs
  • Before Starting
    • Xcode
    • Version Control
    • Swift
    • Naming
  • DATABASES
    • Apple Database
    • 3rd Party Databases
    • Database Comparison
  • Design Patterns
    • Alternatives
    • Comparison
  • Model
    • Accessibility
    • Assets
    • Error Debugging
    • File Management
  • CODES
    • Pseudo Code
    • Frameworks
    • APIs
    • Packages
    • Dependency Managers
    • Libraries
    • Main Pillars (Protocol, Class, Struct, etc.)
    • Data Collectors
    • Properties / Data Containers
    • Property Wrappers
    • Optionals
    • Data Types
    • Operators
    • Conditionals
    • Loops
    • Physical Properties
    • Other Properties
    • Code Pool
  • View
    • Apple HIG
    • Design
    • Image and Graphic
    • Page Elements
      • Button
      • CheckList
      • Confirmation Dialog
      • Context Menu
      • Display Modes
      • Divider
      • Drag and Drop List
      • Form
      • Grid
      • Group
      • GroupBox
      • Keyboard
      • Label
      • LazyView
      • List
      • NavigationLink
      • NavigationSplitView
      • NavigationStack
      • NavigationView
      • NavigationView vs NavigationStack
      • OutlineGroup
      • Picker
      • ProgressView()
      • ScrollView
      • Section
      • Shapes
      • sheet()
      • Slider
      • Stacks
      • TextField
      • Toggle
      • Toolbar
      • ViewBuilder
      • WindowGroup
    • View Modifiers
    • Reporting
    • Others
  • Solutions
    • Case Solutions
    • Sample Project Pool
  • Testing
    • Debugging
    • Testing CheckList
    • Unit Test
  • Documentation
    • GitBook
    • MarkDown
  • Deploying and Publishing
    • Checklist
    • Deployment Processes
    • Publishing Processes
    • ASO - App Store Optimization
  • Kaizen
    • CI-CD
Powered by GitBook
On this page
  1. View
  2. Page Elements

Picker

Overview

Subjects

.tag

Date-Time

Sources

  • Hacking with Swift / How to create a date picker and read values from it

  • DaddyCoding / SwiftUI: DatePicker & TimePicker

  • IOSExample / Creates a DatePickerTextField which shows a TextField associated with a DatePicker

.pickerStyle()

Wheel

.pickerStyle(WheelPickerStyle())

Source: Medium / Sarah / Wheel Picker View in SwiftUI,

Horizontal

Vertical

Segmented

menuPickerStyle

Sample Codes

Example 1

Sources

Videos

Articles / Documents

  • DesignCode / SwiftUi Picker

  • SerialCoder.dev / Working with Picker in SwiftUI

  • Medium / Sarah / Wheel Picker View in SwiftUI

  • StackOverflow / Selecting a picker value to lead to a text field, SwiftUI

  • Waldo / SwiftUI Picker Made Easy: Tutorial With Example

See Also

PreviousOutlineGroupNextProgressView()

Last updated 2 years ago

Was this helpful?

  • Overview
  • Subjects
  • .tag
  • Date-Time
  • .pickerStyle()
  • Sample Codes
  • Example 1
  • Sources
  • Videos
  • Articles / Documents
  • See Also

Was this helpful?

struct ContentView: View {
    let students = ["Harry", "Hermione", "Ron"]
    @State private var selectedStudent = "Harry"

    var body: some View {
        NavigationView {
            Form {
                Picker("Select your student", selection: $selectedStudent) {
                    ForEach(students, id: \.self) {
                        Text($0)
                    }
                }
            }
        }
    }
}