I found this code (written in appdelegate for an application). All I want is to just let it support one more view ( I created it).
The code :
- (IBAction)swap
{
NSArray *subs = [window subviews];
[[subs objectAtIndex:0] removeFromSuperview];
if([subs objectAtIndex:0] == view2){
[window addSubview:view1];
} else if([subs objectAtIndex:0] == view1){
[window addSubview:view2];
}
}
1 Answer