Pass parameters between IOS views

Asked

Viewed 300 times

0

Guys I have a view where I have login ways in my app, if the person choose login or register will be redirected to the same view but depends on the button that is pressed I will present a different screen... How can I pass the parameter to know the option my user made ? Thank you

I got it via appdelegate, I wanted something simpler

  • Are you calling this view via code or using the storyboard? Edit your question and post the snippet of your code to help with the answers

  • Via code. I have no code... I did it by passing the delegate, but I wanted another simpler method...

  • Post what you’ve already done

1 answer

1


If you are using Storyboard simply by mapping the action you can know which button the user pressed at the time. If the buttons are being programmatically allocated, there is the possibility to create an action for the button, which will lead to different methods, through Selector. Storyboard also uses the same Selector argument to map an action from a button. In the case of delegate, the Tags can be used to identify each button, making it easier when the delegate method is called.

I hope I’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.