Array
extension Array
extension Array where Element == RecentItem
-
Seealso
Array.filter(_:)Declaration
Swift
public func filterKeepingFirstAndLast(_ isIncluded: (Element) throws -> Bool) rethrows -> [Element]
-
Seealso
Array.split(maxSplits:omittingEmptySubsequences:whereSeparator:)Declaration
Swift
public func splitExceptAtStartAndEnd(maxSplits: Int = .max, omittingEmptySubsequences: Bool = true, whereSeparator isSeparator: (Element) throws -> Bool) rethrows -> [ArraySlice<Element>]
-
Saves an array of
RecentItem
s to a file at the path specified byrecentItemsPathURL
.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.