iOSView sharing data between

No need to shadow all properties. There is another way that allows to keep views around and access their properties at any time from wherever :

  • Create a global dictionary in a module. I called it Dico
  • In app, put
Dico = New Dictionary
  • In View 1 Deactivate, so the view is saved before pushing another one :

dico.Value("View1") = self

I added a label to View1
I then added a button to pushto a View 2 that contains two buttons :

Sub Action() View1(Dico.Value("View1")).Label1.Text = "Pickaboo" End Sub

Sub Action() self.close End Sub

So one button modifies the content of Label1.Text on View1 from View2, the second one closes View2.

When View1 reappears, the label has been modified.

Note that with this technique you no longer need to create a new view when you want to display again a view that already exists. For instance :

if Dico.HasKey("View2") then PushTo(View2(Dico.Value("View2"))) else Dim newView As New View2 Self.PushTo(newView) end if