Array
public extension Array
public extension Array where Element: Equatable
public extension Array where Element == String
                - 
                  
                  
Return array containing elements of self that are also in other, plus elements from other that are not in self
Declaration
Swift
func updatedPreservingOrder(from other: Array, predicate: (Element, Element) -> Bool) -> [Element]Parameters
otherthe array to update from
predicatereturns true if a pair of elements, one from each array, satisfies it
Return Value
updated array
 - 
                  
                  
Update array in-place to contain elements of self that are also in other, plus elements from other that are not in self
Declaration
Swift
mutating func updatePreservingOrder(from other: Array, predicate: (Element, Element) -> Bool)Parameters
otherthe array to update from
predicatereturns true if a pair of elements, one from each array, satisfies it
 - 
                  
                  
Move the element at old index to new index, modifying self in-place
Declaration
Swift
mutating func move(atIndex old: Index, toIndex new: Index)Parameters
oldindex of the element to move
newnew index of the element
 - 
                  
                  
Move the element at old index to new index
Declaration
Swift
func moved(atIndex old: Index, toIndex new: Index) -> [Element]Parameters
oldindex of the element to move
newnew index of the element
Return Value
modified copy of self
 - 
                  
                  
Move the element matching the predicate to index, modifying self in-place
Declaration
Swift
mutating func move(where predicate: (Element) -> Bool, to index: Index)Parameters
predicateallows the move if true
indexnew position of the element
 - 
                  
                  
Move the element matching the predicate to index
Declaration
Swift
func moved(where predicate: (Element) -> Bool, to index: Index) -> [Element]Parameters
predicateallows the move if true
indexnew position of the element
Return Value
modified copy of self
 
- 
                  
                  
Return array containing elements of self that are also in other, plus elements from other that are not in self
Declaration
Swift
func updatedPreservingOrder(from other: Array) -> [Element]Parameters
otherthe array to update from
Return Value
updated array
 - 
                  
                  
Update array in-place to contain elements of self that are also in other, plus elements from other that are not in self
Declaration
Swift
mutating func updatePreservingOrder(from other: Array)Parameters
otherthe array to update from
 - 
                  
                  
Move the element to index, modifying self in-place
Declaration
Swift
mutating func move(element: Element, to index: Index)Parameters
elementto be moved
indexnew position of the element
 - 
                  
                  
Move the element matching the predicate to index
Declaration
Swift
func moved(element: Element, to index: Index) -> [Element]Parameters
elementto be moved
indexnew position of the element
Return Value
modified copy of self
 
- 
                  
                  
Given an array of strings, each optionally sepatated into prefix and suffix by the separator, sort strings aplhabeticall, but grouped by suffix
Declaration
Swift
func sortedBySuffixAndPrefix(separator: String = "_") -> [Element]Parameters
separatordefaults to “_”
Return Value
sorted array