Array

struct Array<Element> : _DestructorSafeContainer
  • Remove the elements that evaluate to true and return that array.

    Note

    At the time when this function was implemented, the function removeAll(where:) had not been added to Swift. That said, the removeAll(where:) function follows the removeAll() pattern of not returning the elements that were removed unlike the remove(at:) function which has a discardable result of the removed element. Because this function is used within this library to remove elements conditionally and return the elements that were filtered out, this function will be kept in the framework. syoung 04/23/2019

    Declaration

    Swift

    @discardableResult
    public mutating func remove(where evaluate: (Element) throws -> Bool) rethrows -> [Element]

    Parameters

    evaluate

    The function to use to evaluate the search pattern.

    Return Value

    The elements that match the pattern.

  • Use this array to decode an array of objects of the given type.

    Declaration

    Swift

    public func rsd_decode<T>(_ type: Array<T>.Type, bundle: Bundle? = nil) throws -> Array<T> where T : Decodable
  • Declaration

    Swift

    public func encode(to encoder: Encoder) throws