UACustomEvent
@objc
public class UACustomEvent : NSObject
CustomEvent captures information regarding a custom event for Analytics.
-
The event’s value. The value must be between -2^31 and 2^31 - 1 or it will invalidate the event.
Declaration
Swift
@objc public var eventValue: Decimal { get set }
-
The event’s name. The name’s length must not exceed 255 characters or it will invalidate the event.
Declaration
Swift
@objc public var eventName: String { get set }
-
The event’s transaction ID. The ID’s length must not exceed 255 characters or it will invalidate the event.
Declaration
Swift
@objc public var transactionID: String? { get set }
-
The event’s interaction type. The type’s length must not exceed 255 characters or it will invalidate the event.
Declaration
Swift
@objc public var interactionType: String? { get set }
-
The event’s interaction ID. The ID’s length must not exceed 255 characters or it will invalidate the event.
Declaration
Swift
@objc public var interactionID: String? { get set }
-
The event’s properties. Properties must be valid JSON.
Declaration
Swift
@objc public var properties: [String : Any] { get }
-
Default constructor.
Declaration
Swift
@objc public convenience init(name: String)
Parameters
name
The name of the event. The event’s name must not exceed 255 characters or it will invalidate the event.
-
Default constructor.
Declaration
Swift
@objc public convenience init(name: String, value: Double)
Parameters
name
The name of the event. The event’s name must not exceed 255 characters or it will invalidate the event.
value
The event value. The value must be between -2^31 and 2^31 - 1 or it will invalidate the event. Defaults to 1.
-
Default constructor.
Declaration
Swift
@objc public convenience init(name: String, decimalValue: Decimal)
Parameters
name
The name of the event. The event’s name must not exceed 255 characters or it will invalidate the event.
decimalValue
The event value. The value must be between -2^31 and 2^31 - 1 or it will invalidate the event. Defaults to 1.
-
Adds the event to analytics.
Declaration
Swift
@objc public func track()
-
Sets a property string value.
Declaration
Swift
@objc public func setProperty( string: String, forKey key: String )
Parameters
string
The string value to set.
forKey
The properties key
-
Removes a property.
Declaration
Swift
@objc public func removeProperty( forKey key: String )
Parameters
forKey
The properties key
-
Sets a property double value.
Declaration
Swift
@objc public func setProperty( double: Double, forKey key: String )
Parameters
double
The double value to set.
forKey
The properties key
-
Sets a property bool value.
Declaration
Swift
@objc public func setProperty( bool: Bool, forKey key: String )
Parameters
bool
The bool value to set.
forKey
The properties key
-
Sets a property value.
Declaration
Swift
@objc public func setProperty( value: Any, forKey key: String ) throws
Parameters
value
The value to set.
forKey
The properties key
-
Sets a property value.
Declaration
Swift
@objc public func setProperties(_ object: Any) throws
Parameters
value
The values to set. The value must result in a JSON object or an error will be thrown.