<-

UIDocumentInteractionController

Very cool controller. Like the activity controller, but gives you access to other apps.

delegate methods let you:

  • configure the controller view
  • act right before it sends off the file
  • use a document preview controller

Other than calling self for the delegate to allow launching, I have not yet used the delegate.

Key set up:

in the .h

<UIDocumentInteractionControllerDelegate>

in the .m

//you must declare it here as a property (to retain pointer) @interface CBFeditViewController () @property (nonatomic, strong) UIDocumentInteractionController *dController; @end

in a method to trigger the document sharing

if (self.dController == nil) { self.dController = [UIDocumentInteractionController interactionControllerWithURL:fileURL]; self.dController.delegate = self; } else { self.dController.URL = fileURL; }
[self.dController presentOptionsMenuFromRect:self.view.frame inView:self.view animated:YES];