I am referring project from GitHub.
I am trying to modify it according to my requirement, but I am not getting and not able to understand that what code I have to write in didSelectRowAtIndexPath
method.
What I want is that after clicking tableView row it can level 0 or level 1 (here level 0 means - row has no sub child and level 1 means row has subview/child rows )
When I click on any tableView row either level 0 or level 1, it has to navigate to next viewController.
In this example, row number 2 and 3 are expandable i.e it contains level 1 rows, row 0, 1, 4 and 5 are level 1 rows they don't expand.
Here is project link (updated project link)
***** Added Code ****
the code I written in AppDelegate class,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
userDefaults=[NSUserDefaults standardUserDefaults];
mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"loginSuccess"]) {
NSLog(@"Login Done!!!");
HomeViewController *homeVC=[mainStoryboard instantiateViewControllerWithIdentifier:@"homeId"];
SampleNavigationController *navigation = [[SampleNavigationController alloc] initWithRootViewController:homeVC];
//SWRevealViewController * vc= [[SWRevealViewController alloc]init];
//ExpandableTableViewController *sidemenu = (ExpandableTableViewController*)[mainStoryboard instantiateViewControllerWithIdentifier:@"sideMenu"];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = navigation;
[self.window makeKeyAndVisible];
}else
{
LoginViewController *loginVC=[mainStoryboard instantiateViewControllerWithIdentifier:@"LoginId"];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = loginVC;
[self.window makeKeyAndVisible];
}
return YES;
}
And in LoginViewController class, I have written code
- (IBAction)loginButtonMethod:(id)sender {
[self->userdefaults setBool:YES forKey:@"loginSuccess"];
InboxView *inboxVC=[self.storyboard instantiateViewControllerWithIdentifier:@"id1"];
[self.navigationController pushViewController:inboxVC animated:YES];
[[self navigationController] setNavigationBarHidden:NO];
}