Make has(feed) a Container protocol method.
This commit is contained in:
parent
edd9b1cc91
commit
fe2d329301
|
@ -615,10 +615,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
|||
}
|
||||
}
|
||||
|
||||
public func has(_ feed: Feed) -> Bool {
|
||||
return flattenedFeeds().contains(feed)
|
||||
}
|
||||
|
||||
// MARK: - Container
|
||||
|
||||
public func flattenedFeeds() -> Set<Feed> {
|
||||
|
@ -653,6 +649,10 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
|||
postChildrenDidChangeNotification()
|
||||
}
|
||||
|
||||
public func has(_ feed: Feed) -> Bool {
|
||||
return flattenedFeeds().contains(feed)
|
||||
}
|
||||
|
||||
// MARK: - Debug
|
||||
|
||||
public func debugDropConditionalGetInfo() {
|
||||
|
|
|
@ -33,6 +33,7 @@ public protocol Container: class {
|
|||
|
||||
//Recursive — checks subfolders
|
||||
func flattenedFeeds() -> Set<Feed>
|
||||
func has(_ feed: Feed) -> Bool
|
||||
func hasFeed(with feedID: String) -> Bool
|
||||
func hasFeed(withURL url: String) -> Bool
|
||||
func existingFeed(with feedID: String) -> Feed?
|
||||
|
|
|
@ -101,7 +101,11 @@ public final class Folder: DisplayNameProvider, Renamable, Container, UnreadCoun
|
|||
topLevelFeeds.remove(feed)
|
||||
postChildrenDidChangeNotification()
|
||||
}
|
||||
|
||||
|
||||
public func has(_ feed: Feed) -> Bool {
|
||||
return flattenedFeeds().contains(feed)
|
||||
}
|
||||
|
||||
// MARK: - Hashable
|
||||
|
||||
public func hash(into hasher: inout Hasher) {
|
||||
|
|
Loading…
Reference in New Issue