1

I'm working on an app that does some intense photo processing. It's pretty fast for small images, but it can take like 10 seconds for a full-resolution photo.

Is there any way to pull up the interface for UIActivityViewController before I've generated the full-resolution photo?

I'd like to do it in the following order:

  1. User clicks "Share"
  2. Open UIActivityViewController. User selects "Save to Library"
  3. Display a progress bar while we generate the full resolution image and actually save it.

As far as I can tell, UIActivityViewControllerrequires the image when it is initialized. Is there any way around this?

// this step takes 10s, can I defer it until after they choose?
let img = self.fullyRenderedImage(view)

let activity = UIActivityViewController(activityItems: [img], applicationActivities: nil)

// can I present this before I have img ready?
self.presentViewController(activity, animated: true, completion: nil)
Sean Clark Hess
  • 15,859
  • 12
  • 52
  • 100

1 Answers1

1

You might want to think of UIActivityItemSource, set a placeHolder, and process the actual data in the background.

Set different activity items for UIActivityViewController Swift

Community
  • 1
  • 1
dichen
  • 1,643
  • 14
  • 19