Call Panel Controller / Segue

I work with 4 views using the tab bar. At first glance there is a table round golf. The second view allows the user to enter data for a new round. I have a button in the Add Circle view that saves the entered data in Core Data. When the user saves the round, I want the view to move back to the "home screen" where the rounds are displayed. I created a segreya called "SavetoHomeSegue" in the storyboard.

This is the code I use to switch between views

[self performSegueWithIdentifier:@"SavetoHomeSegue" sender:self]; [self.tabBarController setSelectedIndex:0]; 

Here is my problem. When I return to the "Home screen", a table now opens for the first tab AND the second tab. In addition, it looks like the Add Circle view was correctly unloaded, since I had to manually clear the data entry in the text fields before. How to switch from one tab to another and correctly upload views? I posted my views below:

  • Home screen -

Home scree view

  • Add a round view -

enter image description here

0
source share
1 answer

You should definitely not switch between vc tabs. Just save the data and refresh another view on viewWillAppear. Call setSelectedViewController if necessary, but never switch between vc tabs.

+1
source

Source: https://habr.com/ru/post/989496/


All Articles