diff --git a/README.md b/README.md index 9f5e197..8601411 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ - [TextField](#textfield) - [Slider](#slider) - [Date Picker](#date-picker) - - [Segmented Control](#segmented-control) + - [Picker](#picker) - [Stepper](#stepper) - [Tap](#tap) - [Gesture](#gesture) @@ -65,7 +65,7 @@ | UIAlertController with style .actionSheet | [ActionSheet](#alerts-and-action-sheets) | | UIStackView with horizontal axis| [HStack](#hstack) | | UIStackView with vertical axis| [VStack](#vstack) | -| UISegmentedControl | [SegmentedControl](#segmented-control) | +| UISegmentedControl | [Picker](#picker) | | UIStepper | [Stepper](#stepper) | | UIDatePicker | [DatePicker](#date-picker) | | NSAttributedString | No equivalent (use [Text](#text)) | @@ -454,24 +454,25 @@ DatePicker(

-### Segmented Control +### Picker ``` swift @State var favoriteColor = 0 var colors = ["Red", "Green", "Blue"] -SegmentedControl(selection: $favoriteColor) { +Picker("Favorite Color", selection: $favoriteColor) { ForEach(0 ..< colors.count) { index in Text(self.colors[index]) .tag(index) } } +.pickerStyle(SegmentedPickerStyle()) ```
Screenshot

-![](./assets/images/input/segmented_control/1.png) +![](./assets/images/input/picker/1.png)

diff --git a/assets/images/input/segmented_control/1.png b/assets/images/input/picker/1.png similarity index 100% rename from assets/images/input/segmented_control/1.png rename to assets/images/input/picker/1.png