I have a UIViewController named mainScreenViewController that present a tableView of reminders.
When the user selects the first cell (“Add reminder”) I present a UIPageViewController named newReminderPageViewController using presentViewController: animated: completion: and not using UINavigationController.
I have 2 UIViewControllers in the newReminderPageViewController (the pageView), one called colourViewController and the other called titleViewController. On colourViewController the user chooses a colour for the reminder and when the user swipes to the left (swipes to titleViewController using the pageView) the users chooses a title for the reminder.
On titleViewController you have also an “Add” button that creates the reminder (using a model class called Reminder and have 2 properties: colour and title) and go back to mainScreenViewController (using dismissViewControllerAnimated: completion:)
My problem is: I need to pass the new reminder that was created on titleViewController to an array called reminders on mainScreenViewController. I need the specific mainScreenViewController object that is under the newReminderPageViewController (the pageView) with all the information of it so I can’t create a new object (newReminderPageViewController *nRPVC=[newReminderPageViewController alloc]init];).
How can I pass the new reminder which was created on titleViewController to the reminders array on the existing mainScreenViewController?
Thank you!