Other Classes
The following classes are available globally.
-
Listens for application lifecycle events and publishes status changes.
See moreDeclaration
Swift
public class ApplicationStatusListener : NSObject -
A utility class that wraps a
DispatchGroupand makes safer to use and includes an array of results in the completion.Differently from the
See moreDispatchGroup, if the first work completes synchronously the completion won’t be called until all the other work is completed too. All the results then are collected and returned in the completion.Declaration
Swift
public class TealiumDispatchGroup -
A wrapper class around DispatchQueue to only dispatch asynchronously when we are on a different queue.
Making it dispatch synchronously in a generic library would instead be not safe and could lead to deadlocks. An example of deadlock that would look safe is this:
DispatchQueue.main.async { let queue = TealiumQueue(label: "something") queue.ensureOnQueue { print("This will print") DispatchQueue.main.sync { // This is something that a user might do on one of our completions print("This will never print") } } queue.syncOnQueue { // This is something that might be part of our library if we do introduce a method like this print("This will never print") } }Therefore we only have, and only should have, an async method which is
See moreensureOnQueue.Declaration
Swift
public class TealiumQueue -
Utility to replace double brace wrapped text with values extracted from a
See moreDataObject.Declaration
Swift
public class TemplateProcessor
View on GitHub
Other Classes Reference