Search code examples
iosnativeuiactivityviewcontroller

How did the Google Photos iOS app customize the native share sheet (e.g. UIActivityViewController)?


When you share photos in Google Photos for iOS, Google shows their own custom view on top of the UIActivityViewController. I know this can be semi-accomplished by drawing your own view on a top-level UIWindow, but Google also somehow hides the bottom 'Cancel' button and fill in the gaps to make it the UIActivityViewController more "full screen". Are they somehow embedding the UIActivityViewController's view inside their own view?

Google Photos share sheet:

Screenshot of Google Photos share sheet Standard share sheet:

Native UIActivityViewController


Solution

  • I was looking for the answer to this and stumbled upon your question so I tweeted about it. Matthew Bischoff pointed me to this which should more or less explain how it's done. https://github.com/Jasdev/JDSActivityVC

    The short answer is that you subclass UIActivityViewController and mess with the resulting views. Hint: you'll need to mess with the superview of the view controller's view property.