iOS AirPlay Action Sheet for public app store publ

2019-04-16 20:17发布

I've been working on a project that involves AirPlay endpoint selection and was wondering how the guys at Spotify had done the following in-app selection of the available AirPlay endpoints (you can see an AirPlay icon/message at the bottom of the app that when tapped brings up a similar Action Sheet to what you'd see via the Control Center):

Spotify AirPlay Action Sheet

From what I know, the only "public" API one may use for this kind of thing is MPVolumeView which is not necessarily the same, as it'd show a volume controller and a button to trigger such action sheet.

The following blog talks about a MPAudioVideoRoutingPopoverController which is a private API, so wondering if that's what the folks at Spotify are using and if so, why was such thing allowed on the store? (I thought use of private APIs was strictly forbidden by Apple's rules)

If the private route is the only way to achieve it, is there any particular way to do it in a way that Apple would be ok with? ie: like mentioned in an answer to iOS: Airplay picker MPVolumeView alternative around messing with the MPVolumeView and either triggering the UI from there while hiding the rest of the elements?

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-04-16 20:50

This other answer provides an alternative to the approach still using the MPVolumeView class but invoking the touch of the button inside it programmatically while hiding all (or most) of the interface.

查看更多
登录 后发表回答