NetNewsWire/Shared/Data/SmallIconProvider.swift

38 lines
669 B
Swift

//
// SmallIconProvider.swift
// NetNewsWire
//
// Created by Brent Simmons on 12/16/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
import Articles
import Account
import RSCore
protocol SmallIconProvider {
var smallIcon: IconImage? { get }
}
extension Feed: SmallIconProvider {
var smallIcon: IconImage? {
if let iconImage = appDelegate.faviconDownloader.favicon(for: self) {
return iconImage
}
#if os(macOS)
return AppAssets.genericFeedImage
#else
return FaviconGenerator.favicon(self)
#endif
}
}
extension Folder: SmallIconProvider {
var smallIcon: IconImage? {
AppAssets.masterFolderImage
}
}