kiran
kiran

Reputation: 4409

issue with loading view controller

I have two view controller's first which show's gird of button's and second the detailed view when clicking on any button for first View Controller i am loading detailed view controller.

   secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
    [secondViewController setFrame:CGRectMake(300, 60, 430, 620)];
    [self.view addSubview:secondViewController.view];

which need to appear on first view controller and setting frame and adding to second view controller.

When i load[add] my second view controller to the first. Its allow me tap on other button's too i need to restrict on taping on any button when its loaded second view controller.

Upvotes: 0

Views: 66

Answers (2)

Pratyusha Terli
Pratyusha Terli

Reputation: 2343

add a overlay on first view and on it add the second view then your buttons will not be accessible.refer

Upvotes: 1

Paresh Navadiya
Paresh Navadiya

Reputation: 38259

When second view controller added as subview then make all as many buttons u have make userInteractionEnabled to NO which u think not to be taped:

 yourButton.userInteractionEnabled = NO;

When remove second view controller don't forgot to userInteractionEnabled to YES which were made NO:

 yourButton.userInteractionEnabled = YES;

Upvotes: 0

Related Questions