From ed17b02a5fd631bae72c3b752b28eb6c998729e9 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Mon, 22 Jul 2024 20:59:53 +0800 Subject: [PATCH] Use the new macro from Swift compiler and SDK to mark the UIImage/UIImageView subclass matching what they designed to be UIImage subclass should be thread-safe UIImageView subclass should be on MainActor only --- SDWebImage/Core/SDAnimatedImage.h | 1 + SDWebImage/Core/SDAnimatedImageView.h | 1 + 2 files changed, 2 insertions(+) diff --git a/SDWebImage/Core/SDAnimatedImage.h b/SDWebImage/Core/SDAnimatedImage.h index 4f596997..f10a8280 100644 --- a/SDWebImage/Core/SDAnimatedImage.h +++ b/SDWebImage/Core/SDAnimatedImage.h @@ -68,6 +68,7 @@ /** The image class which supports animating on `SDAnimatedImageView`. You can also use it on normal UIImageView/NSImageView. */ +NS_SWIFT_NONISOLATED @interface SDAnimatedImage : UIImage // This class override these methods from UIImage(NSImage), and it supports NSSecureCoding. diff --git a/SDWebImage/Core/SDAnimatedImageView.h b/SDWebImage/Core/SDAnimatedImageView.h index f5f541b1..431be921 100644 --- a/SDWebImage/Core/SDAnimatedImageView.h +++ b/SDWebImage/Core/SDAnimatedImageView.h @@ -19,6 +19,7 @@ For UIKit: use `-startAnimating`, `-stopAnimating` to control animating. `isAnimating` to check animation state. For AppKit: use `-setAnimates:` to control animating, `animates` to check animation state. This view is layer-backed. */ +NS_SWIFT_UI_ACTOR @interface SDAnimatedImageView : UIImageView /** The internal animation player.