I have an NSURL property in my app delegate:
@property (nonatomic, retain) NSURL *openedURL;
…and then:
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
// attempt to extract a token from the url
self.openedURL = url;
// attempt to extract a token from the url
return [FBSession.activeSession handleOpenURL:url];
}
I want to move this code to a normal UIViewController. How can I do that??
Only the appdelegade can have the
openURL:handler, but you can just call a method in any of your controllers, or any NSObject, and perform the code you wish there.