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:
- User clicks "Share"
- Open
UIActivityViewController
. User selects "Save to Library" - Display a progress bar while we generate the full resolution image and actually save it.
As far as I can tell, UIActivityViewController
requires 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)