I'm assuming this is a Xamarin.iOS project. How are you reaching the Second VC (UINavigationController..?). A simple approach (also assuming a UINavigationController) is to create the following in the SecondVC
public int[] values;
Then in the first VC you can create the SecondVC, update the values array, and do any other logic necessary after the values array has been updated.
public OnNavigateToSecondVC() {
var secondVC = new SecondVC();
secondVC.values = values; // Reference to values array from first VC
NavigationController?.PushViewController(secondVC, true);
}
Another approach is to update the constructor of the secondVC to include the ability to pass the values array directly in.
public partial class SecondVC : UIViewController
{
int[] values;
public SecondVC(int[] values) : base("SecondVC", null)
{
this.values = values;
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
}
Swift also has native functionality called : PrepareForSegue
You could also use that if you want : Prepare for Segue in Swift