2

Is there a way to programmatically terminate an iOS app extension?

This would be similar to how you can terminate an actual application with the call

[[UIApplication sharedApplication] terminateWithSuccess];

or the call

exit(EXIT_SUCCESS);
esqew
  • 42,425
  • 27
  • 92
  • 132
arcticmatt
  • 1,956
  • 1
  • 19
  • 36
  • the exit(0) thing works (as seen in the posts this is kind of a duplicate of) – arcticmatt Aug 12 '14 at 21:59
  • or you can do `[self.extensionContext cancelRequestWithError:[NSError errorWithDomain:NSCocoaErrorDomain code:NSUserCancelledError userInfo:nil]];` where `self` is some view controller – user102008 Aug 29 '14 at 22:01
  • that doesn't actually kill the extension, it just dismisses the view controller – arcticmatt Aug 29 '14 at 22:39

0 Answers0