From 85f7bf76aab0855c651bef9cf9b353b63ffe9aa3 Mon Sep 17 00:00:00 2001 From: Muukii Date: Tue, 8 Apr 2025 13:48:08 +0900 Subject: [PATCH 1/2] Patch --- Source/ASConfigurationInternal.mm | 2 +- Source/ASInternalHelpers.mm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/ASConfigurationInternal.mm b/Source/ASConfigurationInternal.mm index 993802d66..bdd0d8e97 100644 --- a/Source/ASConfigurationInternal.mm +++ b/Source/ASConfigurationInternal.mm @@ -51,7 +51,7 @@ - (instancetype)init - (void)frameworkDidInitialize { - ASDisplayNodeAssertMainThread(); +// ASDisplayNodeAssertMainThread(); /* a obstacle to run SwiftUI Preview */ if (_frameworkInitialized) { ASDisplayNodeFailAssert(@"Framework initialized twice."); return; diff --git a/Source/ASInternalHelpers.mm b/Source/ASInternalHelpers.mm index 15fb42811..d5cbbb821 100644 --- a/Source/ASInternalHelpers.mm +++ b/Source/ASInternalHelpers.mm @@ -65,7 +65,7 @@ void ASInitializeFrameworkMainThreadOnConstructor(void) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - ASDisplayNodeCAssertMainThread(); +// ASDisplayNodeCAssertMainThread(); /* a obstacle to run SwiftUI Preview */ ASNotifyInitialized(); #if AS_SIGNPOST_ENABLE _ASInitializeSignpostObservers(); @@ -77,7 +77,7 @@ void ASInitializeFrameworkMainThreadOnDestructor(void) { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - ASDisplayNodeCAssertMainThread(); +// ASDisplayNodeCAssertMainThread(); /* a obstacle to run SwiftUI Preview */ // Ensure these values are cached on the main thread before needed in the background. if (ASActivateExperimentalFeature(ASExperimentalLayerDefaults)) { // Nop. We will gather default values on-demand in ASDefaultAllowsGroupOpacity and ASDefaultAllowsEdgeAntialiasing From 67658a36b4c26f367a11311b135fdc21903e0494 Mon Sep 17 00:00:00 2001 From: Antoine Marandon Date: Fri, 11 Jul 2025 17:01:36 +0900 Subject: [PATCH 2/2] Silence warnings with mainthread --- Source/ASDisplayNode+Beta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/ASDisplayNode+Beta.h b/Source/ASDisplayNode+Beta.h index 585175a2c..a77c7434c 100644 --- a/Source/ASDisplayNode+Beta.h +++ b/Source/ASDisplayNode+Beta.h @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN -ASDK_EXTERN void ASPerformBlockOnMainThread(void (^block)(void)); +ASDK_EXTERN void ASPerformBlockOnMainThread(void NS_SWIFT_UI_ACTOR (^block)(void)); ASDK_EXTERN void ASPerformBlockOnBackgroundThread(void (^block)(void)); // DISPATCH_QUEUE_PRIORITY_DEFAULT /**