Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

2.3 Delegate Methods

dzana edited this page Dec 9, 2014 · 3 revisions

FPPickerControllerDelegate

- (void)fpPickerController:(FPPickerController *)pickerController didFinishPickingMediaWithInfo:(FPMediaInfo *)info;
  • Called after Filepicker finished picking a media.
  • At this point the associated media file should be present in info.mediaURL.
  • Properties in info:
    • mediaURL
      • A local NSURL pointing to the file
        • e.g: assets-library://asset/asset.JPG?id=1000000001&ext=JPG
    • mediaType
      • The UTType for the file
        • e.g: public.image
    • remoteURL
    • filename
      • A NSString with the filename
        • e.g: 202342304.jpg
    • filesize (when available)
      • A NSNumber with the filesize in bytes
        • e.g: 1048576
    • key (when available)
      • An S3 key if the developer has set up Amazon S3 account at Filepicker.io
        • e.g: JENAoTrDSPGFMrdxMd2R_photo.jpg
    • source (when available)
      • A FPSource used for retrieving the media
    • originalAsset (when available; iOS only)
      • A ALAsset pointing to the original asset from the camera roll
    • thumbnailImage (when available; iOS only)
      • A thumbnail-sized UIImage representing the media (only applies to image media)
  • Methods in info:
    • containsImageAtMediaURL
      • YES if mediaURL contains an image; no otherwise
    • containsVideoAtMediaURL
      • YES if mediaURL contains a video; no otherwise
- (void)fpPickerController:(FPPickerController *)pickerController didPickMediaWithInfo:(FPMediaInfo *)info;
  • Called after Filepicker picked a media.
  • Properties in info:
    • thumbnailImage (when available; iOS only)
      • A thumbnail-sized UIImage representing the media
- (void)fpPickerControllerDidCancel:(FPPickerController *)pickerController;
  • Typically called when the picking process is cancelled or a file can't be handled.
- (void)fpPickerController:(FPPickerController *)pickerController didFinishPickingMultipleMediaWithResults:(NSArray *)results;
  • Called after Filepicker finished picking multiple media.
  • At this point the associated media file for each item should be present at info.mediaURL.

FPSaveControllerDelegate Methods

- (void)fpSaveController:(FPSaveController *)saveController didFinishSavingMediaWithInfo:(FPMediaInfo *)info;
  • Called after Filepicker finished saving a media.
- (void)fpSaveController:(FPSaveController *)saveController didError:(NSError *)error;
  • Called when Filepicker failed saving a media.
- (void)fpSaveControllerDidCancel:(FPSaveController *)saveController;
  • Typically called when the save process is cancelled or a file can't be handled.