Classes

The following classes are available globally.

  • Combines multiple Analytics Engines into a single engine.

    Use this only if you have multiple engines.

    See more

    Declaration

    Swift

    final public class CompoundAnalyticsEngine
    extension CompoundAnalyticsEngine: AnalyticsEngine
  • Prints analytics events to standard output.

    This should be used only for debugging purposes. If you’re building for iOS 14+, consider using LoggerAnalyticsEngine instead. You can combine this with your actual analytics engine by using CompoundAnalyticsEngine.

    See more

    Declaration

    Swift

    final public class ConsoleAnalyticsEngine
    extension ConsoleAnalyticsEngine: AnalyticsEngine
  • Logs analytics events to Apple’s unified logging system.

    This should be used only for debugging purposes. You can combine this with your actual analytics engine by using CompoundAnalyticsEngine.

    See more

    Declaration

    Swift

    final public class LoggerAnalyticsEngine
    extension LoggerAnalyticsEngine: AnalyticsEngine
  • Mock analytics engine. Stores events to an allEvents array each time track(event:) is called. It also stores information by event type.

    Use this only for unit testing. Consider whether SpyAnalyticsEngine might be a better fit.

    See more

    Declaration

    Swift

    final public class MockAnalyticsEngine
    extension MockAnalyticsEngine: AnalyticsEngine
  • Spies upon an analytic engine by also tracking events to a separate mock that can be queried.

    Use this only for unit testing. Consider whether MockAnalyticsEngine might be a better fit.

    See more

    Declaration

    Swift

    final public class SpyAnalyticsEngine
    extension SpyAnalyticsEngine: AnalyticsEngine