diff --git a/WordPress/Classes/Utility/Media/FaviconService.swift b/Modules/Sources/WordPressMedia/FaviconService.swift similarity index 92% rename from WordPress/Classes/Utility/Media/FaviconService.swift rename to Modules/Sources/WordPressMedia/FaviconService.swift index 08dc2b89fdb9..43c375b55628 100644 --- a/WordPress/Classes/Utility/Media/FaviconService.swift +++ b/Modules/Sources/WordPressMedia/FaviconService.swift @@ -1,7 +1,7 @@ import UIKit // Fetches URLs for favicons for sites. -actor FaviconService { +public actor FaviconService { static let shared = FaviconService() private nonisolated let cache = FaviconCache() @@ -14,12 +14,12 @@ actor FaviconService { private var tasks: [URL: FaviconTask] = [:] - nonisolated func cachedFavicon(forURL siteURL: URL) -> URL? { + nonisolated public func cachedFavicon(forURL siteURL: URL) -> URL? { cache.cachedFavicon(forURL: siteURL) } /// Returns a favicon URL for the given site. - func favicon(forURL siteURL: URL) async throws -> URL { + public func favicon(forURL siteURL: URL) async throws -> URL { if let faviconURL = cache.cachedFavicon(forURL: siteURL) { return faviconURL } @@ -57,7 +57,7 @@ actor FaviconService { } } -enum FaviconError: Error { +public enum FaviconError: Error, Sendable { case unacceptableStatusCode(_ code: Int) } @@ -105,7 +105,7 @@ private final class FaviconTask { var isCancelled = false var task: Task - init(_ closure: @escaping () async throws -> URL) { + init(_ closure: @escaping @Sendable () async throws -> URL) { self.task = Task { try await closure() } } } diff --git a/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCellViewModel.swift b/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCellViewModel.swift index 0c725e10b6ef..0600cf4b61e4 100644 --- a/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCellViewModel.swift +++ b/WordPress/Classes/ViewRelated/Reader/Cards/ReaderPostCellViewModel.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressMedia final class ReaderPostCellViewModel { // Header diff --git a/WordPress/Classes/ViewRelated/Reader/Views/ReaderSiteIconView.swift b/WordPress/Classes/ViewRelated/Reader/Views/ReaderSiteIconView.swift index 0e138608864b..27363ecacf74 100644 --- a/WordPress/Classes/ViewRelated/Reader/Views/ReaderSiteIconView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Views/ReaderSiteIconView.swift @@ -1,4 +1,5 @@ import SwiftUI +import WordPressMedia struct ReaderSiteIconView: View, Hashable { let site: ReaderSiteTopic