Array
public extension Array
public extension Array where Element: Equatable
public extension Array where Element: Identifiable
-
Returns the element at the given index, or
nilif the given index is out of bounds.Declaration
Swift
subscript(safe idx: Int) -> Element? { get }
-
Excludes all elements in the given array
Declaration
Swift
func exclude(_ other: [Element]) -> [Element]Parameters
otherArray of elements which should be excluded
Return Value
Reduced array without the elements in other
-
Finds the first element where the
idequals theidof the given objectother.Declaration
Swift
func first<T>(byId other: T) -> Element? where T : Identifiable, Element.ID == T.IDParameters
otherOther element which conforms to
IdentifiableReturn Value
The first element of the sequence that has the same
id, or nil if there is no element has the sameid.
View on GitHub