Repository Public MIT
1{2 "accessibility" : [3 "The picker is a system control: label, current value, the list of options and keyboard navigation come from the system.",4 "Option labels built with `Label` keep their text for VoiceOver.",5 "Long option names wrap in the inline presentation and are shown in full in menus."6 ],7 "category" : "selection",8 "changelog" : [9 {10 "changes" : [11 "Release 1.1.0: see the project changelog."12 ],13 "date" : "2026-12-03",14 "version" : "1.1.0"15 },16 {17 "changes" : [18 "Initial release."19 ],20 "date" : "2026-12-02",21 "version" : "1.0.0"22 }23 ],24 "dependencies" : [25 {26 "id" : "glass-foundation",27 "version" : "1.1.0"28 }29 ],30 "description" : "Generic picker over Hashable options, as a menu or a wheel depending on the platform.",31 "examples" : [32 {33 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassPickerExample: GlassExample {\n public static let componentID = \"glass-picker\"\n\n struct Plan: Hashable {\n let name: String\n let symbol: String\n }\n\n private static let plans = [\n Plan(name: \"Starter\", symbol: \"leaf\"),\n Plan(name: \"Team\", symbol: \"person.3\"),\n Plan(name: \"Enterprise with a long name\", symbol: \"building.2\"),\n ]\n\n @State private var plan = GlassPickerExample.plans[0]\n @State private var currency = \"CAD\"\n @State private var hour = 9\n @State private var priority = \"Normal\"\n\n public init() {}\n\n public var body: some View {\n Form {\n GlassPicker(\"Plan\", selection: $plan, options: Self.plans) { plan in\n Label(plan.name, systemImage: plan.symbol)\n }\n GlassPicker(\"Currency\", selection: $currency, options: [\"CAD\", \"EUR\", \"JPY\", \"USD\"])\n GlassPicker(\"Reminder hour\", selection: $hour, options: Array(6...22), presentation: .wheel) { hour in\n \"\\(hour.formatted(.number.precision(.integerLength(2)))):00\"\n }\n GlassPicker(\"Priority\", selection: $priority, options: [\"Low\", \"Normal\", \"High\"], presentation: .inline)\n GlassPicker(\"Region\", selection: .constant(\"Canada\"), options: [\"Canada\"])\n .disabled(true)\n }\n }\n}\n\n#Preview(\"GlassPicker\") { GlassPickerExample() }\n",34 "title" : "GlassPicker example"35 }36 ],37 "files" : [38 {39 "bytes" : 6338,40 "path" : "Forms/Selection/GlassPicker.swift",41 "sha256" : "43fa8f538d612eb5c3d919af8ffad6e46eda6af0c2d73befbc597836ab762f38"42 }43 ],44 "frameworks" : [4546 ],47 "id" : "glass-picker",48 "kind" : "native-wrapper",49 "license" : "MIT",50 "minimumOS" : {51 "iOS" : "26.0",52 "iPadOS" : "26.0",53 "macOS" : "26.0"54 },55 "name" : "GlassPicker",56 "platforms" : [57 "iOS",58 "iPadOS",59 "macOS"60 ],61 "schemaVersion" : 1,62 "sha256" : "db442501089433f9e4d703ca25e10d0116c9291d9117a6429a34c143a5fffc80",63 "symbols" : [64 "GlassPickerPresentation",65 "Resolved",66 "GlassPicker"67 ],68 "version" : "1.1.0"69}70