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/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 /** 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