FREArray
open class FREArray : Sequence
FREArray: Additional type which matches Java version of FRE
-
iterator for FREArray
for fre in airArray { }
Declaration
Swift
public func makeIterator() -> Array<FREObject>.Iterator
-
raw FREObject value
Declaration
Swift
public var rawValue: FREObject?
-
init: Initialise a FREArray from a FREObject.
Declaration
Swift
public init(_ freObject: FREObject)
Parameters
freObject
FREObject which is of AS3 type Array
-
init: Initialise a FREArray containing a Vector of type specified by className.
let newPerson = FREArray(className: "com.tuarua.Person", length: 5, fixed: true)
Declaration
Swift
public init?(className: String, length: Int = 0, fixed: Bool = false, items: [FREObject?]? = nil)
Parameters
className
name of AS3 class to create
length
number of elements in the array
fixed
whether the array is fixed
items
populates the FREArray with the supplied Array of FREObjects
-
init: Initialise a FREArray with a [Int].
Declaration
Swift
public init?(intArray array: [Int])
Parameters
intArray
array to be converted
-
init: Initialise a FREArray with a [UInt].
Declaration
Swift
public init(uintArray array: [UInt])
Parameters
intArray
array to be converted
-
init: Initialise a FREArray with a [String].
Declaration
Swift
public init(stringArray array: [String])
Parameters
stringArray
array to be converted
-
init: Initialise a FREArray with a [String?].
Declaration
Swift
public init(optionalStringArray array: [String?])
Parameters
stringArray
array to be converted
-
init: Initialise a FREArray with a [Double].
Declaration
Swift
public init(doubleArray array: [Double])
Parameters
doubleArray
array to be converted
-
init: Initialise a FREArray with a [NSNumber].
Declaration
Swift
public init(numberArray array: [NSNumber])
Parameters
doubleArray
array to be converted
-
init: Initialise a FREArray with a [Bool].
Declaration
Swift
public init(boolArray array: [Bool])
Parameters
boolArray
array to be converted
-
init: Initialise a FREArray with a [Date].
Declaration
Swift
public init(dateArray array: [Date])
Parameters
dateArray
array to be converted
-
init: Initialise a FREArray with a [Any].
Declaration
Swift
public init(anyArray array: [Any])
Parameters
anyArray
array to be converted
-
push: Adds one or more elements to the end of an array and returns the new length of the array.
Declaration
Swift
@discardableResult public func push(_ args: Any?...) -> UInt
Parameters
args
One or more values to append to the array.
Return Value
UInt An integer representing the length of the new array.
-
insert: Insert a single element into the FREArray.
Declaration
Swift
public func insert(_ freObject: FREObject?, at index: Int)
Parameters
freObject
FREObject
at
An Int that specifies the position in the Vector where the element is to be inserted. You can use a negative Int to specify a position relative to the end of the FREArray (for example, -1 for the last element of the FREArray)
-
remove: Remove a single element from the Vector. This method modifies the FREArray without making a copy.
Declaration
Swift
@discardableResult public func remove(at index: Int) -> FREObject?
Parameters
at
An Int that specifies the index of the element in the FREArray that is to be deleted. / You can use a negative Int to specify a position relative to the end of the FREArray / (for example, -1 for the last element of the Vector).
Return Value
FREObject? The element that was removed from the original FREArray
-
length: Length of FREArray
Declaration
Swift
public var length: UInt { get }
-
isEmpty: A Boolean value indicating whether the FREArray is empty.
Declaration
Swift
public var isEmpty: Bool { get }
-
value: Converts FREArray to Swift array
Declaration
Swift
public var value: [Any?] { get }
Return Value
[Any?]
-
accessor: gets/sets FREObject at position index
Declaration
Swift
subscript(index: UInt) -> FREObject? { get set }
Parameters
index
Return Value
FREObject?
-
accessor: gets/sets FREObject at position index
Declaration
Swift
subscript(index: UInt) -> FREArray? { get set }
Parameters
index
Return Value
FREArray
-
accessor: gets/sets Int at position index
Declaration
Swift
subscript(index: UInt) -> Int { get set }
Parameters
index
Return Value
Int
-
accessor: gets/sets UInt at position index
Declaration
Swift
subscript(index: UInt) -> UInt { get set }
Parameters
index
Return Value
UInt
-
accessor: gets/sets UInt at position index
Declaration
Swift
subscript(index: UInt) -> Bool { get set }
Parameters
index
Return Value
Bool
-
accessor: gets/sets NSNumber at position index
Declaration
Swift
subscript(index: UInt) -> NSNumber { get set }
Parameters
index
Return Value
NSNumber
-
accessor: gets/sets Double at position index
Declaration
Swift
subscript(index: UInt) -> Double { get set }
Parameters
index
Return Value
Double
-
accessor: gets/sets CGFloat at position index
Declaration
Swift
subscript(index: UInt) -> CGFloat { get set }
Parameters
index
Return Value
CGFloat
-
accessor: gets/sets Date at position index
Declaration
Swift
subscript(index: UInt) -> Date { get set }
Parameters
index
Return Value
Date
-
accessor: gets/sets String at position index
Declaration
Swift
subscript(index: UInt) -> String? { get set }
Parameters
index
Return Value
String?