In my viewController2 I have different UIView's, and let's say that when I load my viewController2 from viewController3 I need to show only UIView2. Is it possible to do that?
viewController2, has many forms. For example, after clicking the button on form1 it would hide form1 and show form2 and so on. Now, the problem is if I load my viewController2 from viewController3 is it possible to just show form2 and not form1?
Here's how I load my viewController2:
[APP_DELEGATE setUIBlockingEnabled:[NSNumber numberWithBool:NO]];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
appDelegate.rootViewController = nil;
appDelegate.rootViewController = [[RootViewController alloc] init];
appDelegate.window.rootViewController = appDelegate.rootViewController;
appDelegate.window.backgroundColor = [UIColor clearColor];
RegistrationViewController *controller = [[RegistrationViewController alloc]init];
@property (nonatomic, strong) UIView *rectHolder1;
@property (nonatomic, strong) UIView *rectHolder2;
You should have to manage this kind of stuff in
viewWillAppear of your
viewController2. Set some flag when you come from
VC3 to VC2 so that you can differentiate that you are coming from VC3 or not! If your flag is true(I mean you are coming from VC3) then show your desired view else show other content that you want to show! If you are going forward means you have pushing
VC3(which less possible as per naming of viewcontrollers) then you can use
prepareforsegue to set flag! If you are popping to
VC3 then you can use
delegate and protocol or
NSUserDefaults for store or set the flag!