Array

extension Array
extension Array where Element == RecentItem
  • Saves an array of RecentItems to a file at the path specified by recentItemsPathURL.

    Declaration

    Swift

    @discardableResult
    public func save() -> Bool
  • Adds a recent item to the collection. If a similar recent item is already in the collection, this method updates the timestamp of that item instead of adding a redundant item.

    Declaration

    Swift

    public mutating func add(_ recentItem: RecentItem)

    Parameters

    recentItem

    A recent item to add to the collection.

  • Removes the first matching recent item from the collection.

    Declaration

    Swift

    public mutating func remove(_ recentItem: RecentItem)

    Parameters

    recentItem

    A recent item to remove from the collection.