PTAnalyticsManager

@interface PTAnalyticsManager : NSObject <PTAnalyticsHandler>

The PTAnalyticsManager class dispatches analytics events to registered handlers conforming to the PTAnalyticsHandler protocol. Each event sent to an analytics manager is dispatched to all registered handlers capable of handling the event.

  • The default analytics manager.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, class)
        PTAnalyticsManager *_Nonnull defaultManager;

    Swift

    class var `default`: PTAnalyticsManager { get }
  • The currently registered analytics handlers.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        NSArray<id<PTAnalyticsHandler>> *_Nonnull handlers;

    Swift

    var handlers: [PTAnalyticsHandler] { get set }
  • Registers an analytics handler with the manager.

    Declaration

    Objective-C

    - (void)addHandler:(nonnull id<PTAnalyticsHandler>)handler;

    Swift

    func addHandler(_ handler: PTAnalyticsHandler)

    Parameters

    handler

    the analytics handler to register

  • Removes an analytics handler previously registered with the manager.

    Declaration

    Objective-C

    - (void)removeHandler:(nonnull id<PTAnalyticsHandler>)handler;

    Swift

    func removeHandler(_ handler: PTAnalyticsHandler)

    Parameters

    handler

    the analytics handler to remove