CallViewControllerConfigurationBuilder

@available(iOS 12.0, *)
public class CallViewControllerConfigurationBuilder

A builder that constructs CallViewControllerConfiguration objects.

 let theme = Theme()
 theme.accentColor = .systemBlue

 let config = CallViewControllerConfigurationBuilder()
                 .withFormatter(MyFormatter())
                 .withCallTheme(theme)
                 .withWhiteboardTheme(theme)
                 .withWhiteboardTextEditorTheme(theme)
                 .withFileSharingTheme(theme)
                 .withFeedbackEnabled(theme: theme, autoDismissDelay: 5)
                 .withCustomLocalizations(bundle: .myBundle, tableName: "CallUI")
                 .build()

This object helps you creating CallViewControllerConfiguration objects guiding you in this process with a fluent interface. This object’s methods can be chained together “building” the configuration object in a declarative way.

Remark

This class is meant to be used by Swift code. If your app is written in Objective-c please use the BDKCallViewControllerConfigurationBuilder instead.
  • Call this method when you want to specify the formatter used to format the callees or caller information in the call UI.

    Declaration

    Swift

    @available(*, deprecated, message: "Use withFormatter(_:﹚ instead")
    public func withCallInfoTitleFormatter(_ formatter: Formatter) -> CallViewControllerConfigurationBuilder

    Parameters

    formatter

    The formatter to be used.

    Return Value

    self after storing the formatter.

  • Call this method when you want to specify the formatter used to format the callees or caller information in the call UI.

    Since

    3.5.0

    Declaration

    Swift

    public func withFormatter(_ formatter: Formatter) -> CallViewControllerConfigurationBuilder

    Parameters

    formatter

    The formatter to be used.

    Return Value

    self after storing the formatter.

  • Call this method when you want to specify the URL for the mp4 video simulating a camera while running in the iOS Simulator.

    iOS Simulators lack support for camera, when testing on a simulator you can provide a fake video that will be sent to the call participants as of a camera stream.

    Declaration

    Swift

    public func withFakeCapturerFileURL(_ url: URL) -> CallViewControllerConfigurationBuilder

    Parameters

    url

    The url of the mp4 file used when running the application in the simulator

    Return Value

    self after storing the mp4 file url

  • Call this method when you want to specify the theme instance that is going to be used by CallViewController when presenting the Call UI.

    Declaration

    Swift

    public func withCallTheme(_ theme: Theme) -> CallViewControllerConfigurationBuilder

    Parameters

    theme

    The Theme instance used to customise the Call UI.

    Return Value

    self after storing the theme instance.

  • Call this method when you want to specify the theme instance that is going to be used when presenting the file sharing UI.

    Declaration

    Swift

    public func withFileSharingTheme(_ theme: Theme) -> CallViewControllerConfigurationBuilder

    Parameters

    theme

    The Theme instance used to customise the file sharing UI.

    Return Value

    self after storing the theme instance.

  • Call this method when you want to specify the theme instance that is going to be used when presenting the whiteboard UI.

    Declaration

    Swift

    public func withWhiteboardTheme(_ theme: Theme) -> CallViewControllerConfigurationBuilder

    Parameters

    theme

    The Theme instance used to customise the whiteboard UI.

    Return Value

    self after storing the theme instance.

  • Call this method when you want to specify the theme instance that is going to be used when presenting the whiteboard text editor UI.

    Declaration

    Swift

    public func withWhiteboardTextEditorTheme(_ theme: Theme) -> CallViewControllerConfigurationBuilder

    Parameters

    theme

    The Theme instance used to customise the whiteboard text editor UI.

    Return Value

    self after storing the theme instance.

  • Call this method when you want to enable the call feedback UI at the end of the call.

    Enables a flag determining whether, at the end of the call, the user should be asked to leave a feedback for the call performed, specifying the Theme instance that is going to be used by the feedback UI and the delay in seconds after which the feedback popup is automatically dismissed when the user leaves a feedback.

    Declaration

    Swift

    public func withFeedbackEnabled(theme: Theme = .default(), autoDismissDelay: TimeInterval = 3) -> CallViewControllerConfigurationBuilder

    Parameters

    theme

    The Theme instance used to customise the feedback popup. The default value for this parameter is Theme.default()

    autoDismissDelay

    The interval in seconds after which the feedback is automatically dismissed without the user intervention. The default value for this parameter is 3 seconds

    Return Value

    self after enabling the feedback UI.

  • Call this method when you want to override the Bundle and the filename from which localisations strings are retrieved.

    Declaration

    Swift

    public func withCustomLocalizations(bundle: Bundle, tableName: String = "Localizable") -> CallViewControllerConfigurationBuilder

    Parameters

    bundle

    The bundle containing the table’s strings file you want to use.

    tableName

    The filename from which localisable strings should be retrieved from.

    Return Value

    self after storing the localisation Bundle and table name.

  • Call this method when you want to enable the ringing UI on an incoming call.

    Calling this method will make the ringing UI visible on an incoming call. If CallKit is not enabled calling this method is unnecessary because the ringing UI will be showed anyway.

    Declaration

    Swift

    public func withRingingUIEnabled() -> CallViewControllerConfigurationBuilder

    Return Value

    self after enabling ringing UI showing.

  • Call this method when you want to the CallViewController to be presented in Picture in picture mode.

    Since

    3.7.0

    Declaration

    Swift

    public func withPresentationModePiP() -> CallViewControllerConfigurationBuilder

    Return Value

    self after changing CallViewController presentation mode to CallViewControllerPresentationMode.pip

  • Creates a new builder instance

    Declaration

    Swift

    public init()
  • Builds and returns an instance of a CallViewControllerConfiguration class.

    Declaration

    Swift

    public func build() -> CallViewControllerConfiguration

    Return Value

    a CallViewControllerConfiguration instance built using the configuration values provided.