I have an IOS App that can open a specific type of documents.
My App receives the document through:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
when it was not yet started or through
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
when the App was already started.
When my App is already started the user may have already opened many views in my App. Next when my App is triggered to open the document, how can I open and navigate to the right view (closing the old hierarchy and open the new one to display the document)?
I have tried to use:
- (void)transitionFromViewController:(UIViewController *)fromViewController toViewController:(UIViewController *)toViewController duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion
with fromViewController = the rootViewController (retrieved using UIApplication & UIWindow) and the toViewController: the ViewController I need to display the document but without success.
Any ideas how to progress on this topic? Thanks,
Sébastien.