Picker View and go to specific View controler

Hi there,

I would like to create a PickerViewer that has a “go” button next to it to go to the specific View controller that i have chosen in the Picker View selection.
So the "subject i choos has to be linked to the “Go” button, and this changes every time i chose a new item from the PickeViewer.

Is that even possible? if not could this be possible with a tableView intsead? if not can soemone pleas suggest another solution?

I just did a quick Illustration to show what it is i would like.

thanks for you help,

Kind regards Mattie

Hi Mattie,

Please put this in the app development category, as this isn’t a tutorial request.

Hi Mikaela,

Thanks :slight_smile: i will change it to the app development category hopefully someone can help here.

Kind Regards

1 Like

When you click “go”

You’ll need an @ IBAction, from there you’ll have to grab whatever was selected for your picker view.

Depending on the selection you can present a different view controller

Thanks Mikeala :slight_smile:
I am a complete newbee to this, have you come across a tutorial that resembles this? where Picker viewer and go button?
I have only com across Picker viewer YouTube, i just need the last bit :wink:

With the picker view, you can select something, and then in your IBAction see if you can print what you selected.

Make sure that works, that’s part of the way there.

Inside your go button IBAction, then you’ll probably have some kind of if statement, depending on what’s chosen.

And then look into segues, or google “how to navigate to a different view controller”

Thanks for the hints i will play Sherlock for a bit, and hopefully i will find more clues.

Best of luck! Post here again with what you’ve found and if it works or not! It could help someone else

And yes I’m purposefully not giving you the exact answer. Being able to figure out what you need to search, to do what you’re trying to do is a skill itself! :slight_smile:

I have searched google for into “how to navigate to a different view controller” but i am not coming across any, yet, that have to do with UIPickeView.

I know how to create a button to go to another view controller, so far so good;)

But to go from a “text” that i choose from my list in a UIPickeView to a specific view controller from a “GO” button is quite different. As the UIPickeView is dynamic , but the go button is static - in my logic.

The same “GO” button needs to know which view controller it should go to if you choose 1, 2 or 3 in the UIPickerViewer.
I have tried to illustrate it, in my very quick drawings.

Maybe i need to make a tableView instead o fthe UIPickerViewer?

You just need to look at the current value of the picker when the user taps on the Go button and move to the appropriate view controller based on that value.

Sounds logical :slight_smile:
As i am a newbee would you know of a youtube tutorial were this is shown?

I don’t know of any tutorial that will show you how to do that, specifically, but I mean… any basic UIKit tutorial will give you the info you need to figure out for yourself how to do it.

Okay thanks for the hints, i will keep up the detective work :nerd_face: