FreObjectSwift

@dynamicMemberLookup
open class FreObjectSwift : NSObject

FreObjectSwift: Wraps a FREObject in a dynamicMemberLookup which allows us to perform easy gets and sets of it’s properties

  • rawValue: raw FREObject value

    Declaration

    Swift

    public var rawValue: FREObject?
  • value:

    Declaration

    Swift

    public var value: Any? { get }
  • returns the className of the FREObject

    Declaration

    Swift

    open override var className: String { get }
  • returns the className of the FREObject

  • hasOwnProperty: Indicates whether an object has a specified property defined.

    if argv[0].hasOwnProperty("name") {
    
    }
    

    Declaration

    Swift

    public func hasOwnProperty(name: String) -> Bool

    Parameters

    name

    The property of the FREObject.

    Return Value

    Bool

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let freFirstName: FREObject? = frePerson.firstName
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> FREObject? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    FREObject?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let freChildren: FREArray? = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> FREArray? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    FREArray?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let middleName: String? = frePerson.middleName
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> String? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    String?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let isRightHanded: Bool? = frePerson.isRightHanded
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Bool? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Bool?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let isRightHanded: Bool = frePerson.isRightHanded
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Bool { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Bool

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: Int? = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Int? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Int?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: Int = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Int { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Int

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: UInt? = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> UInt? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    UInt?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: UInt = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> UInt { get set }

    Parameters

    name

    name of the property to return

    Return Value

    UInt

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: NSNumber? = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> NSNumber? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    NSNumber?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let children: NSNumber = frePerson.children
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> NSNumber { get set }

    Parameters

    name

    name of the property to return

    Return Value

    NSNumber

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: CGFloat? = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> CGFloat? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    CGFloat?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: CGFloat = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> CGFloat { get set }

    Parameters

    name

    name of the property to return

    Return Value

    CGFloat

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: Float? = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Float? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Float

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: Float = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Float { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Float

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: Double = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Double? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Double

  • subscript: sets/gets the Property of a FreObjectSwift.

    let frePerson = FreObjectSwift(className: "com.tuarua.Person")
    let height: Double = frePerson.height
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Double { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Double?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person")
    let date: Date? = newPerson.birthday
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> Date? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    Date?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person")
    let eyeColor: UIColor? = newPerson.eyeColor
    
  • subscript: sets/gets the Property of a FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person")
    let eyeColor: NSColor? = newPerson.eyeColor
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> NSColor? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    NSColor?

  • subscript: sets/gets the Property of a FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person")
    let eyeColor: NSColor = newPerson.eyeColor
    

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> NSColor { get set }

    Parameters

    name

    name of the property to return

    Return Value

    NSColor

  • subscript: sets/gets the Property of a FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person", args: 1, true, "Free")
    let myName = newPerson["name"]
    

    Declaration

    Swift

    public subscript(name: String) -> FREObject? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    FREObject?

  • init: Creates a new FreObjectSwift

    Declaration

    Swift

    public init(_ freObject: FREObject?)

    Parameters

    freObject

    FREObject to wrap

  • init: Creates a new FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person", args: 1, true, "Free")
    

    Declaration

    Swift

    public convenience init?(className: String, args: Any?...)

    Parameters

    className

    name of AS3 class to create

    args

    arguments to use. These are automatically converted to FREObjects

  • init: Creates a new FreObjectSwift.

    let newPerson = FreObjectSwift(className: "com.tuarua.Person")
    

    Declaration

    Swift

    public convenience init?(className: String)

    Parameters

    className

    name of AS3 class to create

  • call: Calls a method on a FREObject.

    person.call(method: "add", args: 100, 31)
    

    Declaration

    Swift

    @discardableResult
    public func call(method: String, args: Any...) -> FREObject?

    Parameters

    method

    name of AS3 method to call

    args

    arguments to pass to the method

    Return Value

    FREObject?

  • returns the type of the FREObject

    Declaration

    Swift

    public var type: FreObjectTypeSwift { get }
  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [String]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [String]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [String] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [String]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Int]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Int]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Int] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Int]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [UInt]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [UInt]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [UInt] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [UInt]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Double]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Double]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Double] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Double]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [NSNumber]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [NSNumber]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [NSNumber] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [NSNumber]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Bool]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Bool]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Bool] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Bool]

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Date]? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Date]?

  • subscript: sets/gets the Property of a FreObjectSwift.

    Declaration

    Swift

    public subscript(dynamicMember name: String) -> [Date] { get set }

    Parameters

    name

    name of the property to return

    Return Value

    [Date]

  • subscript: sets/gets the Property of a FREObject.

    let freCoord = FreObjectSwift(className: "com.tuarua.Coordinate")
    let coord: CGPoint = freCoord.latitude
    

    Declaration

    Swift

    subscript(dynamicMember name: String) -> CGPoint? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    CGPoint?

  • subscript: gets the Property of a FREObject.

    let freRoom = FreObjectSwift(className: "com.tuarua.Room")
    let dimensions: CGRect? = freRoom.dimensions
    

    Declaration

    Swift

    subscript(dynamicMember name: String) -> CGRect? { get set }

    Parameters

    name

    name of the property to return

    Return Value

    CGRect?