Add ArticleFetcherType and change state restoration to use new type.

This commit is contained in:
Maurice Parker
2019-11-14 15:06:32 -06:00
parent 48fef65bc4
commit 0d66259650
22 changed files with 290 additions and 230 deletions

View File

@@ -94,16 +94,23 @@ extension Article {
}
}
// MARK: DeepLinkProvider
// MARK: Path
extension Article: DeepLinkProvider {
struct ArticlePathKey {
static let accountID = "accountID"
static let accountName = "accountName"
static let feedID = "feedID"
static let articleID = "articleID"
}
public var deepLinkUserInfo: [AnyHashable : Any] {
extension Article {
public var pathUserInfo: [AnyHashable : Any] {
return [
DeepLinkKey.accountID.rawValue: accountID,
DeepLinkKey.accountName.rawValue: account?.nameForDisplay ?? "",
DeepLinkKey.feedID.rawValue: feedID,
DeepLinkKey.articleID.rawValue: articleID
ArticlePathKey.accountID: accountID,
ArticlePathKey.accountName: account?.nameForDisplay ?? "",
ArticlePathKey.feedID: feedID,
ArticlePathKey.articleID: articleID
]
}