init(object:)
Creates and returns an array containing a given object.
Declaration
convenience init(object anObject: Any)Parameters
- anObject:
An object.
Return Value
An array containing the single element anObject.
Discussion
Alternatively, you can use array literal syntax in Objective-C or Swift to create an array containing a given object: