I have a project that is using the SWReveal controller, however, when the user selects an item from the menu all the app is doing is refreshing the data on the front view controller meaning that a new view controller is never called so the rear view never gets dismissed.
How can I manually close the rear view controller? So when a user clicks on a menu item I want the rearview to disappear and be replaced again by the front view.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *storyboard;
storyboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:nil];
NSString *SelectedRow = [self.menuItems objectAtIndex:indexPath.row];
if([[SelectedRow valueForKey:@"name"]isEqualToString:@"title"]){
//Main Menu
[self performSegueWithIdentifier:@"unwindToMenu" sender:self];
}
else
{
NSMutableDictionary *data = [[NSMutableDictionary alloc] init];
[data setObject:[SelectedRow valueForKey:@"name"] forKey:@"name"];
[data setObject:[SelectedRow valueForKey:@"jobNumber"] forKey:@"jobNumber"];
[data setValue:[NSString stringWithFormat:@"%d", (indexPath.row -1)] forKey:@"indexNumber"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"menuFormSelected" object:nil userInfo:data];
}
}