Rate this page:

Comparison of screen sharing approaches in iOS

In iOS, there are several APIs responsible for setting up screen capture, the mechanism underlying the screen sharing function.

The choice of a suitable approach can be hard for developers, so in this article, we'll explain how to make this choice based on the application functions requiring capturing screen.

Please note

Screen sharing is only available on a device running iOS 10 or higher.

The table below will help you understand which approach is most suitable for which case. But let’s go through the nuances you may need to know before examining it.

Screen sharing approaches

  1. Application process is to start sharing the screen directly from the application.

It’s suitable for calls and app streaming; you do not need to create or search for a separate extension, which is very convenient.

  1. Broadcast Upload App extension is to receive the media samples handed by ReplayKit and encode them, create a video stream, and upload it to the online service.

It’s suitable for calls where you don't need to get additional information from the user, everything is already known to initiate the frame transmission.

  1. Broadcast Setup UI App extension is to give the broadcast a particular name, ask the user to enter login credentials or any other details you may need to fire up your broadcast. BroadcastSetupUIAppex here launches the BroadcastUploadAppex to start the stream.

This one is good for app streaming and streaming services (i.e. game streaming), since it draws the UI before starting the stream, and the user can enter some data there.

Content available for sharing

Each approach supports different sharing areas.

Application process allows sharing the app screen only; it means that when the app is minimized, we’ll see black frames.

Broadcast Upload App extension allows sharing the whole device screen with menu, widgets, etc.

Broadcast Setup UI App extension allows sharing the app screen only; only one application that supports the BroadcastSetupUIAppex launch for a capture session.

Terms

  • App Extension is a highly resource-limited separate process that has its own lifecycle, distributed within the application bundle, but nevertheless has a separate signature and bundle identifier.

  • Host app is an app that a user employs to choose an app extension.

  • Containing app is an app that contains, distributes, bundles, and installs app extensions.

Find more information in the Apple documentation.

Application process

Broadcast Upload App extension

Broadcast Setup UI App extension

Applicable use cases

Screen sharing in calls, App Streaming

Screen sharing in calls

App Streaming, Streaming service

App extensions in the bundle

None

BroadcastUploadAppex

BroadcastSetupUIAppex, BroadcastUploadAppex

Available since

iOS 11.0

iOS 11.0

iOS 10.0

Content available for sharing

Only the app screen in the foreground

Everything including menu, widgets, other apps

Only the app screen in the foreground

Host app

Containing app

iOS11: only Control Panel
iOS12+: control panel, containing app or any other installed app that uses
RPSystemBroadcastPickerView

Containing app or any other installed app that uses load(handler:) for launching the broadcast activity UI

Rotation during capturing

Blocked

Possible

Blocked

Available codecs

H264, VP8

H264

H264

Watch this video from WWDC to learn more.