ObjectiveC <Custom UI> Share Extension Cancel button

412 views Asked by At

this could be something silly but I have this Share NSExtension implemented for my app which is holding custom UI built in MainInterface.storyboard (image attached). Now the question is, how do I back out of it?

I've tried:

  • [self.navigationController popViewControllerAnimated:YES];
  • [self dismissViewControllerAnimated:YES completion:nil];
  • [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];

..but it does not work;

The only way I got it to exit is:

  • @throw @""; (which I don't even think will pass Apple's submission validation..)

What am I missing?

Thanks.

MainInterface.storyboard

1

There are 1 answers

0
siburb On

With extensions you need to tell the system that you're finished.

It will be something like:
[self.extensionContext completeRequestReturningItems:nil completionHandler:nil];