Questions tagged [pickerview]
72 questions
0
votes
1 answer
SwiftUI | Access PickerView selection from another SwiftUI View
I tired to build a multicomponent picker based on user3441734 solution for a dynamic picker. This picker lives in its own .swift file. I can’t figure out how to save the selection in a variable to access it from another view again.
Here is my code…

Daniel
- 568
- 3
- 15
0
votes
1 answer
Swift Dictionary UIPickerView (key) and (value) Swift
I'm currently developing an app using Swift where I use a UIPickerView. I want to set the value in the pickerView (myPickerView)
let PickerData = {
"listOfGrouoc": {
"1": "DDDDD",
"2": "SDDDDD",
"3": "TTTT"
},
"TypeOfGrpos": [
…

Sham Dhiman
- 1,348
- 1
- 21
- 59
0
votes
0 answers
Problem With Multiple PickerViews in one View Controller
So I am getting this strange problem as I try to use multiple PickerViews in one view controller. I have set it up so that I use an if / else if so that it checks which picker to put the correct data to. I have 3 pickers total, and the first two…

cgreene
- 59
- 6
0
votes
1 answer
Using enums case as segment control to show types of data in pickerview
I am new in swift and I was thinking a way to populate data ideally with segment control which I did not attempt before.
VC has layout below
CategoryType Segment Control : to control CategoryType)
CategoryTextField with picker function : keyboard…

Junyong Yap
- 25
- 1
- 5
0
votes
1 answer
How can I navigate to different views?
I am learning to use Swiftui and I need your help. The following pickers are present in my project:
Picker(selection: $selectedChoose, label: Text("Cosa ti serve?")) {
ForEach(0 ..< choose.count) {
…

Charles2020
- 1
- 1
0
votes
1 answer
How can I change the choices in a pickerview based on another pickervew?
Picture of current versionI currently have two picker views. Ones a country picker view(US and Canada) and the other is a state picker view. I'd like to have it so when USA is selected it displays US states, and when Canada is selected, Canadian…

Cyanide
- 11
- 2
0
votes
3 answers
Do I need to add constraints to my UIToolBar if I'm adding it as a subview to my UIPickerView?
I'm trying to add a simple "Done" button to my UIPickerView programmatically, without using storyboards.
When I try to add toolBar as a subview of the UIPickerView, the toolbar doesn't even show up and I get some constraint related errors.
Any idea…
user12329049
0
votes
2 answers
Why this picker crashes when I'm setting its ItemsSource at second time?
I'm storing a List of Objects in App.cs because I want to persist the data while the user walks across other content pages(using navigation page). When he backs to page that has the Picker,
I wish to have the same items on it but it crashs the app…

Sandro Benevides
- 581
- 2
- 14
0
votes
1 answer
SwiftUI PickerView with working CallBack HOW?
Ok -
I want a picker view to pick one operator: "=","<",">"
This operator will be sent as a binding:
@Binding var op:String
My Picker:
Picker(selection: binding, label: Text("Query Type")) {
ForEach(0..

jimijon
- 2,046
- 1
- 20
- 39
0
votes
1 answer
how can i access the text of an Uitextfield in an alert?
i have created a alert with two textfields and the inputView of the second texfield is a pickerview. I can access the text of the first textfield by alert.textfields?.first?.text. I want to display the picker view items in the second textfield, but…

flolopi
- 43
- 6
0
votes
1 answer
Having trouble integrating multiple pickerviews in the same view
I am trying to set up two pickerviews on one view, but I don't want to show the wheels, I just want the wheels to pop up when the specific text box is clicked. I can get it to work for one Pickerview, but when I try and add the second, the…

bb4
- 15
- 3
0
votes
1 answer
How to change my second pickerView's array based on the selection from the 1st pickerView
I have two pickerViews i.e. pickerView1 = car_make, pickerView2 = car_model.
If I select car_make = Kia, I want pickerView2 to show the array of models [Rio, Venga, Ceed], and if I selected car_make=Ford from pickerView1, then I want pickerView2 to…

user11797977
- 1
- 2
0
votes
1 answer
conditions or if statements in pickerview
I need really help with making the logic here, so I've got 3 different arrays that I use in my UIPickerView .when user selects something like this in a pickerview a certain formula should execute (its not relevant which it is)
what should I use? if…

Swift newbie
- 51
- 1
- 2
0
votes
0 answers
UIPickerView Default Rolls back changed
I am beside myself. My simple task is to use a pickerView to set a default value if it was previouly set When it closed. But the problem is in ny logic. It rolls to the default row and sets the title but when I try to change it, it scrolls back to…

Belga
- 1
- 2
0
votes
1 answer
Multiple UIPickerView select first row programmatically in Swift
I find same case for one pickerView, I will say same words like below:
I have a pickerView that pops up when a textField is clicked inside. The user selects their location in the pickerView, and it's put into the textField.
When opening the…

Mayday
- 187
- 2
- 8