Learn Courses My Dashboard

Question information sharing

have a question regarding a code / design I want to have in my app and I thought I might as well just ask you.

Here is the situation:

Imagine you have 2 views.
The first view contains:

  • 3 drop down menus with 3 options (A,B,C) each
  • one text field containing a name followed by an checkbox containing an “-“
  • one button called “release”

The second view contains:

  • 3 empty text fields
  • one text field containing a name
  • one button called “read”

What I want To achieve is that, if user 1 changes the Dropdown menus to let’s say - 1. A, 2. B 3. C - and taps the “release” button, the second view automatically shows the contents of the Dropdown menus in the empty text fields. And if user 2 hits the “read” button the checkbox on the first screen changes from “-“ to “:white_check_mark:

Is that at all possible?

Thank you so much for hopefully taking the time to think about my problem :slight_smile:

Welcome to the community @ArneFinnern !

Yes this is definitely possible! You’ll need to pass data between your view controllers. And then depending on the data do something different with the second view.

The first video is using delegates/protocols, to pass data. The second is another way to pass data.