I am making sample project to implement top menu.

Below is the project structure.

enter image description here

TopMenu is the parent view with structure shown below.

enter image description here

In TopViewController, viewDidLoad below is what I have.

NSString *whereToGo = [[NSUserDefaults standardUserDefaults] valueForKey:@"whereToGo"]; // this is DarkGray by default
UIViewController *goToViewController;
goToViewController = [self.storyboard instantiateViewControllerWithIdentifier:whereToGo];
goToViewController.view.frame = bottomView.bounds;
// bottomView is the first view (will bring child here)
[bottomView addSubview:goToViewController.view];
[self addChildViewController:goToViewController];
[goToViewController didMoveToParentViewController:self];

Now when I execute project, I see Dark Gray, but when I click on Click Me button, nothing occurs.

Any reason why this is happening?

Sample project for download

Related posts

Recent Viewed