Initializer

init(array:)

Initializes a newly allocated array by placing in it the objects contained in a given array.

Declaration

convenience init(array: [Any])

Parameters

anArray

An array.

Return Value

An array initialized to contain the objects in anArray. The returned object might be different than the original receiver.

Discussion

After an immutable array has been initialized in this way, it cannot be modified.

See Also

Initializing an Array

init()

Initializes a newly allocated array.

init(array: [Any], copyItems: Bool)

Initializes a newly allocated array using anArray as the source of data objects for the array.

init?(contentsOfFile: String)

Initializes a newly allocated array with the contents of the file specified by a given path.

Deprecated
init?(contentsOf: URL)

Initializes a newly allocated array with the contents of the location specified by a given URL.

Deprecated
init(objects: UnsafePointer<AnyObject>?, count: Int)

Initializes a newly allocated array to include a given number of objects from a given C array.