romaonthego / REFrostedViewController

iOS 7/8 style blurred view controller that appears on top of your view controller.
MIT License
2.96k stars 494 forks source link

Reloading ViewControllers #20

Closed haxinc closed 10 years ago

haxinc commented 10 years ago

Hi ..

Can I disable reloading view controllers while it changing from the menu ?

romaonthego commented 10 years ago

Not sure what you mean by that, but all selection handling is here:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    UINavigationController *navigationController = (UINavigationController *)self.frostedViewController.contentViewController;

    if (indexPath.section == 0 && indexPath.row == 0) {
        DEMOHomeViewController *homeViewController = [[DEMOHomeViewController alloc] init];
        navigationController.viewControllers = @[homeViewController];
    } else {
        DEMOSecondViewController *secondViewController = [[DEMOSecondViewController alloc] init];
        navigationController.viewControllers = @[secondViewController];
    }

    [self.frostedViewController hideMenuViewController];
}

The controller doesn't provide menu by default, it's up to you how to design it.