IVSStage

Objective-C


@interface IVSStage : NSObject <IVSErrorSource>

Swift

class IVSStage : NSObject, IVSErrorSource

The main interaction point for interacting with the Stage SDK.

  • Creates an IVSStage with the provided token.

    Note

    The IVSStage holds a weak reference to the IVSStageStrategy object.

    Declaration

    Objective-C

    - (nullable instancetype)initWithToken:(nonnull NSString *)token
                                  strategy:(nonnull id<IVSStageStrategy>)strategy
                                     error:(NSError *_Nullable *_Nullable)outError;

    Parameters

    token

    A token acquired by the IVS control plane, used to connect to a Stage.

    strategy

    The strategy used by this stage to make decisions. See IVSStageStrategy for more information.

    outError

    On input, a pointer to an error object. If an error occurs, the pointer is an NSError object that describes the error. If you don’t want error information, pass in nil.

  • Joins the Stage associated with the token provided during initialization.

    Declaration

    Objective-C

    - (BOOL)joinWithError:(NSError *_Nullable *_Nullable)outError;

    Swift

    func join() throws

    Parameters

    outError

    On input, a pointer to an error object. If an error occurs, the pointer is an NSError object that describes the error. If you don’t want error information, pass in nil.

  • Leave the current Stage

    Declaration

    Objective-C

    - (void)leave;

    Swift

    func leave()
  • Adds a renderer to the list of renderers that will be notified of updates to the Stage.

    Declaration

    Objective-C

    - (void)addRenderer:(nonnull id<IVSStageRenderer>)renderer;

    Parameters

    renderer

    The renderer to add.

  • Removes a renderer to the list of renderers that will be notified of updates to the Stage.

    Declaration

    Objective-C

    - (void)removeRenderer:(nonnull id<IVSStageRenderer>)renderer;

    Parameters

    renderer

    The renderer to remove.

  • Asynchronously sets the strategy used by this IVSStage. See IVSStageStrategy for more information.

    Note

    The IVSStage holds a weak reference to the IVSStageStrategy object.

    Declaration

    Objective-C

    - (void)replaceStrategy:(nonnull id<IVSStageStrategy>)strategy;

    Parameters

    strategy

    The new strategy to use with the Stage.

  • Triggers the IVSStageStrategy on this instance to refresh its state. This is how host applications will make changes to how they are interacting with a Stage.

    Declaration

    Objective-C

    - (void)refreshStrategy;

    Swift

    func refreshStrategy()