Fix concurrency warnings.

This commit is contained in:
Brent Simmons 2024-04-19 22:30:37 -07:00
parent 3d83c7cfb6
commit b64b1307b7
6 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ public extension RSImage {
/// ///
/// - Parameter color: The color to use to tint the image. /// - Parameter color: The color to use to tint the image.
/// - Returns: The tinted image. /// - Returns: The tinted image.
func tinted(color: UIColor) -> UIImage? { @MainActor func tinted(color: UIColor) -> UIImage? {
let image = withRenderingMode(.alwaysTemplate) let image = withRenderingMode(.alwaysTemplate)
let imageView = UIImageView(image: image) let imageView = UIImageView(image: image)
imageView.tintColor = color imageView.tintColor = color

View File

@ -19,7 +19,7 @@ extension AccountType {
// TODO: Move this to the Account Package. // TODO: Move this to the Account Package.
func localizedAccountName() -> String { @MainActor func localizedAccountName() -> String {
switch self { switch self {
case .onMyMac: case .onMyMac:
@ -54,7 +54,7 @@ extension AccountType {
} }
// MARK: - SwiftUI Images // MARK: - SwiftUI Images
func image() -> Image { @MainActor func image() -> Image {
switch self { switch self {
case .onMyMac: case .onMyMac:
// If it's the multiplatform app, the asset catalog contains assets for // If it's the multiplatform app, the asset catalog contains assets for

View File

@ -18,7 +18,7 @@ enum ReadFilterType {
protocol SidebarItem: SidebarItemIdentifiable, ArticleFetcher, DisplayNameProvider, UnreadCountProvider { protocol SidebarItem: SidebarItemIdentifiable, ArticleFetcher, DisplayNameProvider, UnreadCountProvider {
var account: Account? { get } @MainActor var account: Account? { get }
@MainActor var defaultReadFilterType: ReadFilterType { get } @MainActor var defaultReadFilterType: ReadFilterType { get }
} }

View File

@ -39,7 +39,7 @@ struct AppAssets {
static let articleExtractorOffSF = UIImage(systemName: "doc.plaintext")! static let articleExtractorOffSF = UIImage(systemName: "doc.plaintext")!
static let articleExtractorOffTinted: UIImage = { @MainActor static let articleExtractorOffTinted: UIImage = {
let image = UIImage(named: "articleExtractorOff")! let image = UIImage(named: "articleExtractorOff")!
return image.tinted(color: AppAssets.primaryAccentColor)! return image.tinted(color: AppAssets.primaryAccentColor)!
}() }()
@ -48,7 +48,7 @@ struct AppAssets {
static let articleExtractorOnSF = UIImage(named: "articleExtractorOnSF")! static let articleExtractorOnSF = UIImage(named: "articleExtractorOnSF")!
static let articleExtractorOnTinted: UIImage = { @MainActor static let articleExtractorOnTinted: UIImage = {
let image = UIImage(named: "articleExtractorOn")! let image = UIImage(named: "articleExtractorOn")!
return image.tinted(color: AppAssets.primaryAccentColor)! return image.tinted(color: AppAssets.primaryAccentColor)!
}() }()

View File

@ -15,7 +15,7 @@ enum ArticleExtractorButtonState {
case off case off
} }
class ArticleExtractorButton: UIButton { @MainActor final class ArticleExtractorButton: UIButton {
private var animatedLayer: CALayer? private var animatedLayer: CALayer?

View File

@ -9,7 +9,7 @@
import Foundation import Foundation
/// Used to select which animations should be performed /// Used to select which animations should be performed
public struct Animations: OptionSet { public struct Animations: OptionSet, Sendable {
/// Select and deslections will be animated. /// Select and deslections will be animated.
public static let select = Animations(rawValue: 1) public static let select = Animations(rawValue: 1)