title: how to call viewWillAppear after redirecting from safari to view controller in IOS
body: <p>I am using Flickr in my app. When I click on Flickr button it is redirecting to safari to login with Flickr and Authorization.</p>
  
  <p>Then after successful authorization it is redirecting to my app. But after redirecting I want to call ViewWillAppear. I also set <code>&lt;UIApplicationDelegate&gt;</code> at my view. But it is not calling any of the below methods.</p>
  
  <pre><code> -(void)viewDidAppear:(BOOL)animated
  {
      [super viewDidAppear:YES];
  
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@Flickr Authorized is completed");
  }
  - (void)UIApplicationWillEnterForeground:(UIApplication *)application
  {
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@Flickr Authorized is completed at foreground");
  }
  - (void)applicationDidBecomeActive:(UIApplication *)application {
      /*
       Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
       */
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@Flickr Authorized is completed at become active");
  }
  - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
  {
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@@Flickr Authorized is completed at openURL");
  }
  -(void)viewWillAppear:(BOOL)animated
  {
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@Flickr Authorized is completed at viewWillAppear");
  
      [super viewWillAppear:YES];
  }
  </code></pre>
  
  <p>But Below method is calling after redirecting from safari at AppDelegate. I have used Code from SnapAndRun flickr sample.</p>
  
  <pre><code>- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
  {
      NSLog(@"@@@@@@@@@@@@@@@@@@@@@@Call Back Here@@@@@@@@@@@");
  
      if ([self flickrRequest].sessionInfo)
      {
          // already running some other request
          NSLog(@"Already running some other request");
      }
      else {
          NSString *token = nil;
          NSString *verifier = nil;
          BOOL result = OFExtractOAuthCallback(url, [NSURL URLWithString:SRCallbackURLBaseString], &amp;token, &amp;verifier);
  
          if (!result) {
              NSLog(@"Cannot obtain token/secret from URL: %@", [url absoluteString]);
              return NO;
          }
  
          [self flickrRequest].sessionInfo = kGetAccessTokenStep;
          [flickrRequest fetchOAuthAccessTokenWithRequestToken:token verifier:verifier];
          [activityIndicator startAnimating];
          //[viewController.view addSubview:progressView];
      }
  
      return YES;
  }
  </code></pre>
  
  <p>I know that we can call my view controllers method here. But Is there any alternative for default delegate method to be called after redirecting at my view itself.</p>
  
  <p>Any Suggestions will be appreciated. 
  Thanks in Advance.</p>