Array
public extension Array
-
Adds the given value at the beginning of the array
Declaration
Swift
@discardableResult mutating func prepend(_ element: Element) -> Array<Element>Parameters
elementnew element that needs to be added
Return Value
Self -
Adds the given array items at the beginning of the array
Declaration
Swift
@discardableResult mutating func prepend(_ elements: [Element]) -> Array<Element>Parameters
elementsnew elements array that needs to be added
Return Value
Self -
Safely deletes the item at the given index
Declaration
Swift
@discardableResult mutating func safeDelete(at index: Int) -> Element?Parameters
indexat which items should be deleted
Return Value
Selfornilif given index is invalid
View on GitHub
Array Extension Reference