Question

My code at the moment looks like this:

- (UIDocumentInteractionController *) setupControllerWithURL:(NSURL *)fileURL
                                           usingDelegate:(id <UIDocumentInteractionControllerDelegate>)         interactionDelegate {

    UIDocumentInteractionController *interactionController =
    [UIDocumentInteractionController interactionControllerWithURL:fileURL];
    interactionController.delegate = interactionDelegate;

    [interactionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];

    return interactionController;

}

- (void)showOptionsMenu
{
    NSURL *fileURL = [NSURL fileURLWithPath:@"2bm.key"];
    docController = [self setupControllerWithURL:fileURL
                                   usingDelegate:self];
}

- (IBAction)KeynoteButton:(id)sender {

     [self showOptionsMenu];
}

This generates an open in keynote bubble at the top left of the screen. Is it possible for me to move where this bubble appears? Or even better can I force a touch event on this bubble so the user does not have a choice, keynote opens automatically? I cannot use an URL reference scheme for this as keynote does not support this.

Thanks

Was it helpful?

Solution

You specify where the popover appears by specifying the proper location in the presentOpenInMenuFromRect:inView:animated: method. Right now you specify CGRectZero. Pass in the proper CGRect that indicates where you want it to appear.

You can't force a specific app. Many users will have several apps that can open the given file. Let the user choose where it is to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top