The Hit List Diary #23 – Share Extension Animation

I’ve been experimenting lately with share extensions. One thing that puzzled me for quite a while was how the share extension gets animated onscreen.

If you use Apple’s supplied SLComposeServiceViewController, it smoothly pops into existence. I was then playing with a custom UI and couldn’t seem to get my animation anywhere near smooth!

Eventually it dawned on me that there is no animation provided by Apple for custom share views. I was being misled by the keyboard animating in and tricking me into thinking the rest of the UI was animating in an extremely stuttery fashion! It also didn’t help that Tom Harrington’s otherwise excellent App Extension Development Tips contained this nugget which had lodged itself at the back of my brain:

Share extensions are presented with a modal-style vertical animation from the bottom of the screen, while action extensions just sort of appear.

I expect that was true at some point, but at least as of iOS 8.1, it appears all animation is your own responsibility. (Pete Callaway suggested to me it was discussed in a WWDC video, but I’ve not been able to find anything explicit so far)

Armed with this knowledge, what I’ve wound up with is using the extension’s ‑viewDidAppear: method as the trigger point for a custom modal presentation to give the animation I desire.

© Mike Abdullah 2007-2015