I was accessing one of the Apple websites about Pickers. The site below:
I was interessed to use the Picker below, but I can't identify what type of element is that.
It appears to be an element to choose between two options("daily Notification Avg" or "A to Z").
What is the element/object ?
You can use a picker
with segmented
style
struct ContentView: View {
@State private var selected = 0
var body: some View {
VStack {
Picker("", selection: $selected) {
Text("Daily Notification Avg").tag(0)
Text("A to Z").tag(1)
}
.pickerStyle(.segmented)
}
}
}
segmentedControl = UISegmentedControl (items: ["Daily Notification Avg","A to Z"])
segmentedControl.frame = CGRectMake(60, 250,200, 30)
segmentedControl.selectedSegmentIndex = 0
segmentedControl.addTarget(self, action: #selector(segmentedControlAction(_)), forControlEvents: .ValueChanged)
view.addSubview(segmentedControl)