Picker Grid List Toggle
SwiftUI Mastery Travel Discovery
In this lesson, we'll go over how to create a Toggle component that looks like UIKit's UISegmentedControl. Building this is rather simple using the Picker component along with a bindable @State variable.

Comments (2)
iTollMouS
2 years ago
wondering why you haven't chosen this way init() { UISegmentedControl.appearance().selectedSegmentTintColor = .gray UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor: UIColor.white], for: .selected) UISegmentedControl.appearance().setTitleTextAttributes([.foregroundColor: UIColor.black], for: .normal) } answered in :- https://stackoverflow.com/questions/57735761/how-to-change-selected-segment-color-in-swiftui-segmented-picker/57915459
iTollMouS
2 years ago
thats what happens when you dont wait for 10 seconds , lol . I saw you made it like that .
Brian Voong
2 years ago
dniswhite
2 years ago
probably just a style or interface preference. I wanted the picker to always show at the top so I moved it above the ScrollView and than added everything into a VStack. Is there some formatting issue that I am not aware of that would be a reason to not do this?
HELP & SUPPORT