• Help
  • Tealium for Swift 3.x
  • Tealium for iOS (Swift) SDK Reference
    • Tealium
      • Tealium
      • TealiumConfig
      • TealiumError
      • TealiumInstanceManager
      • CoreSettings
      • CoreSettingsBuilder
    • Modules
      • Modules
      • – Types
      • AppData
      • Collect
      • ConnectivityData
      • DataLayer
      • DeepLinkHandler
      • DeviceData
      • Lifecycle
      • MomentsAPI
      • TealiumData
      • TimeData
      • Trace
      • CustomModules
    • AppData Module
      • AppDataSettingsBuilder
    • Collect Module
      • CollectSettingsBuilder
    • ConnectivityData Module
      • ConnectivityDataSettingsBuilder
    • Consent
      • ConsentConfigurationBuilder
      • ConsentDecision
      • – DecisionType
      • CMPAdapter
    • DataLayer Module
      • DataLayerSettingsBuilder
    • DeepLinkHandler Module
      • DeepLinkSettingsBuilder
      • Referrer
    • DeviceData Module
      • DeviceDataSettingsBuilder
    • Lifecycle Module
      • LifecycleDataTarget
      • LifecycleError
      • LifecycleEvent
      • LifecycleSettingsBuilder
    • MomentsAPI Module
      • MomentsAPIError
      • MomentsAPIRegion
      • MomentsAPISettingsBuilder
      • EngineResponse
    • TealiumData Module
      • TealiumDataSettingsBuilder
    • TimeData Module
      • TimeDataSettingsBuilder
    • Trace Module
      • TraceSettingsBuilder
    • Rules
      • Rule
      • RuleModuleSettingsBuilder
      • RuleNotFoundError
      • Condition
      • – Operator
      • ConditionEvaluationError
      • InvalidMatchError
    • Barriers
      • Barriers
      • Barrier
      • BarrierFactory
      • BarrierRegistrar
      • BarrierScope
      • BarrierSettingsBuilder
      • BarrierState
      • BatchingBarrierSettingsBuilder
      • ConfigurableBarrier
      • ConnectivityBarrierSettingsBuilder
    • Transformations
      • TransformationOperation
      • TransformationScope
      • TransformationSettings
    • Module
      • Module
      • BasicModule
      • BasicModuleFactory
      • ModuleError
      • ModuleFactory
      • ModuleProxy
      • ModuleSettingsBuilder
      • ModuleStoreProvider
      • ModulesManager
      • MultipleInstancesModuleSettingsBuilder
      • Collector
      • CollectorSettingsBuilder
      • Dispatcher
      • DispatcherSettingsBuilder
      • TealiumContext
      • Transformer
      • TransformerRegistrar
      • Mappings
      • – VariableOptions
      • – ConstantOptions
      • – CommandOptions
      • MappingsBuilder
    • Data
      • DataInput
      • DataInputConvertible
      • DataItem
      • DataItemConverter
      • DataItemExtractor
      • DataObject
      • DataObjectConvertible
      • DataStore
      • DataStoreEdit
      • DataStoreEditor
      • DatabaseError
      • Expiry
      • Dispatch
      • DispatchContext
      • – Source
      • DispatchType
      • JSONArrayPath
      • JSONObjectPath
      • JSONPath
      • JSONPathExtractable
      • JSONPathParseError
      • ArrayRoot
      • ObjectRoot
      • PathRoot
      • ReferenceContainer
      • StringContainer
      • ValueContainer
      • AnyCodable
      • AnyDecodable
      • AnyEncodable
    • PubSub
      • Observable
      • ObservableConvertible
      • ObservableState
      • Observables
      • BasePublisher
      • Publisher
      • ReplaySubject
      • StateSubject
      • Subject
      • Single
      • SingleResult
      • CompositeDisposable
      • Disposable
      • Disposables
      • Subscribable
      • ValueExtractor
    • Network
      • NetworkClient
      • NetworkConfiguration
      • NetworkError
      • NetworkHelper
      • NetworkHelperProtocol
      • NetworkResponse
      • NetworkResult
      • ConnectivityManager
      • ConnectivityManagerProtocol
      • HTTPClient
      • DefaultInterceptor
      • InterceptorManager
      • InterceptorManagerProtocol
      • RequestInterceptor
      • RefreshParameters
      • ResourceRefresher
      • ResourceCacher
      • RetryPolicy
      • URL
      • URLComponents
      • URLConvertible
      • ErrorCooldown
      • ObjectResponse
      • ObjectResult
    • Logging
      • LogCategory
      • LogHandler
      • LogLevel
      • – Minimum
      • LoggerProtocol
      • TealiumLoggerType
      • OSSignpostIntervalState
      • SignpostStateWrapper
      • TealiumSignpostInterval
      • TealiumSignposter
    • Other Classes
      • ApplicationStatusListener
      • RepeatingTimer
      • TealiumDispatchGroup
      • TealiumQueue
      • TemplateProcessor
    • Other Enumerations
      • LenientConverters
      • TealiumConstants
      • TealiumDataKey
      • TimeUnit
    • Other Extensions
      • Array
      • Bool
      • Decimal
      • Dictionary
      • Double
      • Float
      • Int
      • Int64
      • NSNull
      • NSNumber
      • Optional
      • Result
      • String
      • [String: DataInput]
      • [String: DataItem]
    • Other Functions
      • +(_:_:)
      • +=(_:_:)
    • Other Protocols
      • ErrorEnum
      • ErrorExtractor
      • ErrorWrapping
      • QueueMetrics
      • Repeater
      • SessionRegistry
      • Tracker
    • Other Structures
      • ApplicationStatus
      • – StatusType
      • Session
      • – Status
      • TimeFrame
      • TrackResult
      • – Status
    • Other Type Aliases
      • InitializationResult
      • TrackResultCompletion
  • Tealium for Swift SDK Reference

Data Reference

  • DataInput From TealiumPrismCore

    DataInput is a protocol used to limit the type of data that can be sent to Tealium to later serialize it into JSON.

    Warning

    Do not conform custom types to the DataInput protocol or it will defeat the purpose of this protocol.

    Converting a custom object to a DataInput can be done easily by adopting the DataInputConvertible protocol and implementing the DataInputConvertible.toDataInput() method for a safe conversion.

    Valid DataInput can only be:

    • a String
    • a Number: Int, Int64, Double, Float, Decimal, NSNumber
    • a Bool
    • an Array or Dictionary containing only Strings, Numbers or Booleans or other nested Arrays and Dictionaries containing other valid DataInput

    Warning

    Non conforming floats like Double.nan or Float.infinity will be silently converted to strings “NaN” and “Infinity” (or “-Infinity” for negative “Infinity”) upon serialization inside of the library.

    Declaration

    Swift

    public protocol DataInput
  • DataInputConvertible

    Use this protocol to convert custom types to a valid DataInput.

    This is particularly useful for types like enums or objects that can be safely represented with a Dictionary or an Array or a combination of nested Dictionaries and Arrays. Everything that is not a Dictionary or an Array, including the elements contained in those collections, need to be one of the supported DataInput.

    For cases in which you have only nested Arrays and Dictionaries that only contain valid DataInput, implementing this protocol is not necessary and you can just wrap them with the prebuilt DataItem wrapper.

    Although not preferable, you can make any Encodable type a DataInputConvertible by wrapping it with DataItem(serializing:). Note that this method can fail, so you must handle the eventual EncodingError that can be thrown in case of failure.

    See more

    Declaration

    Swift

    public protocol DataInputConvertible
  • DataItem

    A wrapper class that contains a generic JSON value.

    You can use the utility getters to obtain the value in the correct type:

    • You can read any number as Int/Float/Double/NSNumber intercheangebly since it’s backed by an NSNumber on disk.
    • Arrays and Dictionaries will always contain DataItem as values and you can use specific getter to get the correct types from them too.

    Warning

    Do NOT cast this wrapper class to anything else as it will fail. Use the appropriate conversion methods instead.

    Mistake example:

      let numbers: [Int?]? = DataItem(value: [1, 2, 3]).getDataArray() as? [Int?] // Cast will fail and numbers will be nil
      let numbers: [Int?]? = DataItem(value: [1, 2, 3]).getArray() // This will succeed
      let numbers: [Int?]? = DataItem(value: [1, 2, 3]).getDataArray().map { $0.getInt() } // This will also succeed
      let numbers: [Int]? = DataItem(value: [1, 2, 3]).getArray().compactMap { $0 } // This will also succeed and remove potentially nil values from the array
    
    See more

    Declaration

    Swift

    final public class DataItem
    extension DataItem: DataInputConvertible
    extension DataItem: Decodable
  • DataItemConverter

    Classes that implement this protocol should be able to reconstruct an object of type Convertible from a given DataItem, on the assumption that the DataItem accurately describes all components required to create a new instance of type Convertible.

    See more

    Declaration

    Swift

    public protocol DataItemConverter<Convertible>
  • DataItemExtractor

    A container of key-value pairs that can return a DataItem for a given String key.

    See more

    Declaration

    Swift

    public protocol DataItemExtractor : JSONPathExtractable where Self.Root == ObjectRoot
  • DataObject

    A custom wrapper around a common Dictionary used to limit the DataInput types into the Dictionary.

    Only valid DataInput types will be stored in the inner Dictionary and only DataInputConvertible types can be used to initialize this wrapper object.

    See more

    Declaration

    Swift

    public struct DataObject : ExpressibleByDictionaryLiteral
    extension DataObject: Codable
    extension DataObject: DataItemExtractor
    extension DataObject: DataInputConvertible
    extension DataObject: CustomStringConvertible
    extension DataObject: Equatable
  • DataObjectConvertible

    Use this protocol to convert custom types to their DataObject representation.

    See more

    Declaration

    Swift

    public protocol DataObjectConvertible : DataInputConvertible
  • DataStore

    Generic data storage for storing DataInput and retrieving DataItem objects.

    Implementations are not guaranteed to be persistent. For instance, in cases where there may be insufficient storage space on the device, or other reasons such as write permissions etc.

    Stored data requires an Expiry to be provided when storing, and expired data will not be included in any retrieval operations; that is, expired data won’t be returned by get or getAll but it will also not be included in any aggregate methods such as keys or count.

    See more

    Declaration

    Swift

    public protocol DataStore : AnyObject, DataItemExtractor
  • DataStoreEdit

    A data store edit for a specific key

    See more

    Declaration

    Swift

    public enum DataStoreEdit
  • DataStoreEditor

    Enables editing multiple entries in the module storage in a transactional way.

    See more

    Declaration

    Swift

    public protocol DataStoreEditor
  • DatabaseError

    Errors that can occur during database operations.

    See more

    Declaration

    Swift

    public enum DatabaseError : ErrorEnum, ErrorWrapping
  • Expiry

    The expiration type of some persisted value.

    See more

    Declaration

    Swift

    public enum Expiry : Equatable
  • Dispatch

    Represents a tracking event or view to be dispatched.

    See more

    Declaration

    Swift

    public struct Dispatch
  • DispatchContext

    Context with information around the track that generated the Dispatch request.

    See more

    Declaration

    Swift

    public struct DispatchContext
  • DispatchType

    The type of dispatch being sent.

    See more

    Declaration

    Swift

    public enum DispatchType : String
  • JSONArrayPath From TealiumPrismCore

    A JSONPath that can be applied to a JSON array to represent the path to a potentially nested value. Nested items can be in both JSON objects and JSON arrays.

    To create a path like [0].container.array[0].property you can use a subscript for each path component:

     JSONPath[0]["container"]["array"][0]["property"]
    

    Declaration

    Swift

    public typealias JSONArrayPath = JSONPath<ArrayRoot>
  • JSONObjectPath From TealiumPrismCore

    A JSONPath that can be applied to a JSON object to represent the path to a potentially nested value. Nested items can be in both JSON objects and JSON arrays.

    To create a path like container.array[0].property you can use a subscript for each path component:

     JSONPath["container"]["array"][0]["property"]
    

    Declaration

    Swift

    public typealias JSONObjectPath = JSONPath<ObjectRoot>
  • JSONPath

    A structure representing the location of an item in a JSON object or JSON array, potentially nested in other JSON objects and JSON arrays.

    To create a basic JSONPath you can call the JSONPath subscript with a String or an Int depending on where you want to start the path from: the first one would start from a JSON object, the second would start from a JSON array.

     let objectPath = JSONPath["container"]
     let arrayPath = JSONPath[0]
    

    To create a path like container.array[0].property you can use a subscript for each path component:

     JSONPath["container"]["array"][0]["property"]
    
    See more

    Declaration

    Swift

    public struct JSONPath<Root> where Root : PathRoot
    extension JSONPath: Equatable
  • JSONPathExtractable

    A generic container of items that can return a DataItem for a given JSONPath.

    See more

    Declaration

    Swift

    public protocol JSONPathExtractable<Root>
  • JSONPathParseError

    An error occurred while trying to parse a String into a JSONPath

    See more

    Declaration

    Swift

    public struct JSONPathParseError : Error, CustomStringConvertible
  • ArrayRoot From TealiumPrismCore

    A Phantom Type used to specify a type of JSONPath that can be applied to a JSON array.

    Declaration

    Swift

    public enum ArrayRoot : PathRoot
  • ObjectRoot From TealiumPrismCore

    A Phantom Type used to specify a type of JSONPath that can be applied to a JSON object.

    Declaration

    Swift

    public enum ObjectRoot : PathRoot
  • PathRoot From TealiumPrismCore

    An internal protocol used to differentiate between ObjectRoot and ArrayRoot. Do not adopt this protocol in other types.

    Declaration

    Swift

    public protocol PathRoot
  • ReferenceContainer

    A container for a reference to a variable in the data layer.

    See more

    Declaration

    Swift

    public struct ReferenceContainer : Equatable
    extension ReferenceContainer: DataObjectConvertible
  • StringContainer

    A container for a string value

    See more

    Declaration

    Swift

    public struct StringContainer : Equatable
    extension StringContainer: DataObjectConvertible
  • ValueContainer

    A container for a value that is stored as a DataItem.

    See more

    Declaration

    Swift

    public struct ValueContainer
    extension ValueContainer: DataObjectConvertible
  • AnyCodable

    A type-erased Codable value.

    The AnyCodable type forwards encoding and decoding responsibilities to an underlying value, hiding its specific underlying type.

    You can encode or decode mixed-type values in dictionaries and other collections that require Encodable or Decodable conformance by declaring their contained type to be AnyCodable.

    See also

    AnyEncodable

    See also

    AnyDecodable
    See more

    Declaration

    Swift

    public struct AnyCodable : Codable
    extension AnyCodable: CustomStringConvertible
    extension AnyCodable: CustomDebugStringConvertible
  • AnyDecodable

    A type-erased Decodable value.

    The AnyDecodable type forwards decoding responsibilities to an underlying value, hiding its specific underlying type.

    You can decode mixed-type values in dictionaries and other collections that require Decodable conformance by declaring their contained type to be AnyDecodable:

    let json = “”“ { "boolean”: true, “integer”: 1, “double”: 3.14159265358979323846, “string”: “string”, “array”: [1, 2, 3], “nested”: { “a”: “alpha”, “b”: “bravo”, “c”: “charlie” } } “”“.data(using: .utf8)!

    let decoder = JSONDecoder() let dictionary = try! decoder.decode([String: AnyCodable].self, from: json)

    See more

    Declaration

    Swift

    public struct AnyDecodable : Decodable
    extension AnyDecodable: CustomStringConvertible
    extension AnyDecodable: CustomDebugStringConvertible
  • AnyEncodable

    A type-erased encodable value that forwards encoding responsibilities to an underlying value.

    See more

    Declaration

    Swift

    public struct AnyEncodable : Encodable
    extension AnyEncodable: CustomStringConvertible
    extension AnyEncodable: CustomDebugStringConvertible
    extension AnyEncodable: ExpressibleByNilLiteral
    extension AnyEncodable: ExpressibleByBooleanLiteral
    extension AnyEncodable: ExpressibleByIntegerLiteral
    extension AnyEncodable: ExpressibleByFloatLiteral
    extension AnyEncodable: ExpressibleByArrayLiteral
    extension AnyEncodable: ExpressibleByDictionaryLiteral

© 2026 Tealium. All rights reserved. (Last updated: 2026-02-19)

Generated by jazzy ♪♫ v0.15.4, a Realm project.