TealiumInstanceManager
public class TealiumInstanceManager
A class that creates and stores all the created Tealium instances and reuse all of its dependencies
when a new instance is created with the same account and profile.
All references to created Tealium instances are kept weak so that an app that removes all their references
to a Tealium instance will automatically deallocate that instance.
-
The shared
TealiumInstanceManagerobject.Declaration
Swift
public static let shared: TealiumInstanceManager -
Creates a new
Tealiuminstance based on the providedconfig.Typical usage in an app would be to keep a reference of the returned instance to keep it alive for as long as the app is alive. However, the returned
Tealiumshould be shutdown by the user when no longer required by removing all strong references to the returned instance.If you don’t hold a strong reference to the returned instance, it will immediately shut down.
Declaration
Swift
public func create(config: TealiumConfig, completion: ((InitializationResult<Tealium>) -> Void)? = nil) -> TealiumParameters
configThe required configuration options for this instance.
completionThe callback allows the caller to be notified once the instance is ready, or has failed during initialization alongside the cause of the failure.
Return Value
The
Tealiuminstance ready to accept input, although if the initialization fails, any method calls made to this object will also fail. -
Retrieves an existing
Tealiuminstance, if one has already been created using itsTealiumConfig.keyand is still alive.Declaration
Swift
public func get(_ config: TealiumConfig, completion: @escaping (Tealium?) -> Void)Parameters
configThe config that was used to create the instance.
completionThe block to receive the
Tealiuminstance on, if found. -
Retrieves an existing
Tealiuminstance, if one has already been created using itsTealiumConfig.keyand is still alive.Declaration
Swift
public func get(_ key: String, completion: @escaping (Tealium?) -> Void)
View on GitHub