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

别来无恙 提交于 2019-12-19 04:14:09

问题


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:

Standard share sheet:


回答1:


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.



来源:https://stackoverflow.com/questions/47562936/how-did-the-google-photos-ios-app-customize-the-native-share-sheet-e-g-uiactiv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!