From fb518b5acb02aa6ca41be7018bb1619aaef3dc13 Mon Sep 17 00:00:00 2001 From: Daniel Jilg Date: Wed, 29 Dec 2021 18:20:59 +0100 Subject: [PATCH] Add isInitialized property --- Sources/TelemetryClient/TelemetryClient.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/TelemetryClient/TelemetryClient.swift b/Sources/TelemetryClient/TelemetryClient.swift index a08f31a..9463136 100644 --- a/Sources/TelemetryClient/TelemetryClient.swift +++ b/Sources/TelemetryClient/TelemetryClient.swift @@ -121,6 +121,11 @@ public final class TelemetryManagerConfiguration { /// /// Use an instance of `TelemetryManagerConfiguration` to configure this at initialization and during its lifetime. public class TelemetryManager { + /// Returns `true` when the TelemetryManager already has been initialized correctly, `false` otherwise. + public static var isInitialized: Bool { + initializedTelemetryManager != nil + } + public static func initialize(with configuration: TelemetryManagerConfiguration) { initializedTelemetryManager = TelemetryManager(configuration: configuration) }