How to perform Segue in AppDelegate?

前端 未结 3 2075
广开言路
广开言路 2021-02-20 06:28

I am trying to complete an application on IOS 5.1 with Storyboard. Basically I am doing a dropbox app. Since I am using Dropbox SDK link to Dropbox is handled in AppDelegate.m.

3条回答
  •  情话喂你
    2021-02-20 07:06

    If you consider pushing view manually rather then segueperform following code most probably will work for you

    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
        if ([[DBSession sharedSession] handleOpenURL:url]) {
            if ([[DBSession sharedSession] isLinked]) {
    
                NSLog(@"App linked successfully!");
                // At this point you can start making API calls
    
                //push view manually 
                UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
                LoginDropboxViewController *ivc = [storyboard instantiateViewControllerWithIdentifier:@"LoginDropbox"];
                [(UINavigationController*)self.window.rootViewController pushViewController:ivc animated:NO];
    
    
    
        }
            return YES;
        }
        // Add whatever other url handling code your app requires here
        return NO;
    }
    

提交回复
热议问题