Alright so I've two ViewController
. One is the root and the other one is a filterView that applies some filters on root view controller. FilterView has a TableView
on it with multiple selection options. When I tap the UIButton
on root view, it shows the filter view which has the table and I select multiple options form it and when I dismiss the filterView it successfully dismiss it and by using a delegate method it successfully made changes to the RootViewController
.
See the image below to have a more clear picture. The button on left (Three Horizontal Bars) will show the filter view controller and similarly the down button shows root view again.
My question is that when I again taps on the button it load the whole table all over again. With no selected value. I want it to hold the checked values so that user can un-check them and check new filter values.
When user taps the filter button here is the code which I'm using:
- (IBAction)filterButton:(id)sender
{
FilterViewController *arvc = [self.storyboard instantiateViewControllerWithIdentifier:@"FilterView"];
[self presentViewController:arvc animated:YES completion:nil];
}
And for back button on FilterView I'm using this:
[self dismissViewControllerAnimated:YES completion:nil];
So what should i write in back button so that it should keep the multiple checked rows and show if the user view it again. Or something which hide it in the background and show when needed.