Scope

public class Scope

An object which represents an active event scope which can be used to either commit or cancel the scope.

  • End recording the event scope and report all generated events.

    This function saves the events to disk locally and then asynchronously sends them to the server. The optional completion function is called when the event data has been successfully persisted, and not when the actual upload has completed.

    An exception will be thrown if this scope has already been committed or cancelled (i.e. if isActive is false).

    Declaration

    Swift

    public func commit(completion: ((Swift.Error?) -> Void)? = nil)
  • Cancel this event scope and discard all generated events.

    An exception will be thrown if this scope has already been committed or cancelled (i.e. if isActive is false).

    Declaration

    Swift

    public func cancel()
  • True if this scope has not been committed or cancelled, and false otherwise.

    Declaration

    Swift

    public var isActive: Bool { get }
  • End recording the event scope and report all generated events.

    This function saves the events to disk locally and then asynchronously sends them to the server. The returned future is fulfilled when the event data has been successfully persisted, and not when the actual upload has completed.

    An exception will be thrown if this scope has already been committed or cancelled (i.e. if isActive is false).

    Declaration

    Swift

    @_disfavoredOverload
    public func commit() -> Future<Void, Error>