Add convenience method to Set<Article> for just getting unread articles.
This commit is contained in:
parent
f5bfadfb33
commit
863de80281
|
@ -75,6 +75,12 @@ public extension Set where Element == Article {
|
||||||
|
|
||||||
return Set<String>(map { $0.articleID })
|
return Set<String>(map { $0.articleID })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func unreadArticles() -> Set<Article> {
|
||||||
|
|
||||||
|
let articles = self.filter { !$0.status.read }
|
||||||
|
return Set(articles)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public extension Array where Element == Article {
|
public extension Array where Element == Article {
|
||||||
|
|
Loading…
Reference in New Issue