I have a Parent viewController
named "CenterViewConroller" and Child viewController
named "InventoryViewController". I have a UIButton
in CenterViewController
, when i click the Button childView
should appear at given dimension and when i again click on parentcontroller
child view should disappear.
I am adding child view on button click as:
InventoryViewController *invent = [[InventoryViewController alloc] initWithNibName:@"InventoryViewController" bundle:nil];
// iRosaAppDelegate_iPhone *appDelegate = [UIApplication sharedApplication].delegate;
[invent.view setFrame:CGRectMake(400,100,320,200)];
[self addChildViewController:invent];
[self.view addSubview:invent.view];
[invent didMoveToParentViewController:self];
How do i remove ChildView
on same button click?