ObjcLDValue

@objc(LDValue)
public final class ObjcLDValue : NSObject

Bridged LDValue type for Objective-C.

Can create instances from Objective-C with the provided of static functions, for example [LDValue ofBool:YES].

  • The Swift LDValue enum the instance is wrapping.

    Declaration

    Swift

    public let wrappedValue: LDValue
  • Create a instance of the bridging object for the given value.

    Declaration

    Swift

    public init(wrappedValue: LDValue)

    Parameters

    wrappedValue

    The value to wrap.

  • Create a new LDValue that represents a JSON null.

    Declaration

    Swift

    @objc
    public static func ofNull() -> ObjcLDValue
  • Create a new LDValue from a boolean value.

    Declaration

    Swift

    @objc
    public static func of(bool: Bool) -> ObjcLDValue
  • Create a new LDValue from a numeric value.

    Declaration

    Swift

    @objc
    public static func of(number: NSNumber) -> ObjcLDValue
  • Create a new LDValue from a string value.

    Declaration

    Swift

    @objc
    public static func of(string: String) -> ObjcLDValue
  • Create a new LDValue from an array of values.

    Declaration

    Swift

    @objc
    public static func of(array: [ObjcLDValue]) -> ObjcLDValue
  • Create a new LDValue object from dictionary of values.

    Declaration

    Swift

    @objc
    public static func of(dict: [String : ObjcLDValue]) -> ObjcLDValue
  • Get the type of the value.

    Declaration

    Swift

    @objc
    public func getType() -> ObjcLDValueType
  • Get the value as a Bool.

    Declaration

    Swift

    @objc
    public func boolValue() -> Bool

    Return Value

    The contained boolean value or NO if the value is not a boolean.

  • Get the value as a Double.

    Declaration

    Swift

    @objc
    public func doubleValue() -> Double

    Return Value

    The contained double value or 0.0 if the value is not a number.

  • Get the value as a String.

    Declaration

    Swift

    @objc
    public func stringValue() -> String

    Return Value

    The contained string value or the empty string if the value is not a string.

  • Get the value as an array.

    Declaration

    Swift

    @objc
    public func arrayValue() -> [ObjcLDValue]

    Return Value

    An array of the contained values, or the empty array if the value is not an array.

  • Get the value as a dictionary representing the JSON object

    Declaration

    Swift

    @objc
    public func dictValue() -> [String : ObjcLDValue]

    Return Value

    A dictionary representing the JSON object, or the empty dictionary if the value is not a dictionary.