mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add scoped searching of articles
This commit is contained in:
31
Shared/SmartFeeds/SearchTimelineFeedDelegate.swift
Normal file
31
Shared/SmartFeeds/SearchTimelineFeedDelegate.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// SearchTimelineFeedDelegate.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Maurice Parker on 8/31/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Account
|
||||
import Articles
|
||||
|
||||
struct SearchTimelineFeedDelegate: SmartFeedDelegate {
|
||||
|
||||
var nameForDisplay: String {
|
||||
return nameForDisplayPrefix + searchString
|
||||
}
|
||||
|
||||
let nameForDisplayPrefix = NSLocalizedString("Search: ", comment: "Search smart feed title prefix")
|
||||
let searchString: String
|
||||
let fetchType: FetchType
|
||||
|
||||
init(searchString: String, articleIDs: Set<String>) {
|
||||
self.searchString = searchString
|
||||
self.fetchType = .searchWithArticleIDs(searchString, articleIDs)
|
||||
}
|
||||
|
||||
func fetchUnreadCount(for: Account, callback: @escaping (Int) -> Void) {
|
||||
// TODO: after 5.0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user