Array
struct Array<Element> : RandomAccessCollection, MutableCollection
-
Append iff
!self.contains(newElement)Declaration
Swift
public mutating func appendIfUnique(_ newElement: Element)Parameters
newElementElement to possibly append
-
Appends each element iff
!self.contains(newElement)Declaration
Swift
public mutating func appendUniqueContents(of newElements: [Element])Parameters
newElementsElements to possibly append
-
Returns an array of Elements not included in self
Declaration
Swift
public func uniqueContents(of newElements: [Element]) -> [Element]Parameters
newElementsElements to compare
Return Value
Array of unique elements
-
Returns count of unique elements
Declaration
Swift
public func uniqueCount(from newElements: [Element]) -> IntParameters
newElementsElements to compare
Return Value
Count of uniques
-
Removes element if it exists in self
Declaration
Swift
public mutating func removeElement(_ element: Element)Parameters
elementElement to remove
-
Safely subscripts an array, returning nil if index is out of bounds
Declaration
Swift
subscript (safe index: UInt) -> Element?Parameters
index -
Safely subscripts an array, returning nil if index is out of bounds
Declaration
Swift
subscript (safe index: Int) -> Element?Parameters
index -
Safely subscripts an array, returning nil if index is out of bounds
Declaration
Swift
func at(safe index: UInt) -> Element?Parameters
index -
Safely subscripts an array, returning nil if index is out of bounds
Declaration
Swift
func at(safe index: Int) -> Element?Parameters
index
Array Extension Reference