diff --git a/Source/ASDisplayNode+Layout.mm b/Source/ASDisplayNode+Layout.mm index 79b485897..25d44b87b 100644 --- a/Source/ASDisplayNode+Layout.mm +++ b/Source/ASDisplayNode+Layout.mm @@ -137,12 +137,7 @@ - (void)setPrimitiveTraitCollection:(ASPrimitiveTraitCollection)traitCollection _primitiveTraitCollection = traitCollection; l.unlock(); - if (ASActivateExperimentalFeature(ASExperimentalTraitCollectionDidChangeWithPreviousCollection)) { [self asyncTraitCollectionDidChangeWithPreviousTraitCollection:previousTraitCollection]; - } else { - [self asyncTraitCollectionDidChange]; - } - } } diff --git a/Source/ASDisplayNode+Subclasses.h b/Source/ASDisplayNode+Subclasses.h index 8caa64666..9adb9336a 100644 --- a/Source/ASDisplayNode+Subclasses.h +++ b/Source/ASDisplayNode+Subclasses.h @@ -201,23 +201,12 @@ AS_CATEGORY_IMPLEMENTABLE - (void)interfaceStateDidChange:(ASInterfaceState)newState fromState:(ASInterfaceState)oldState ASDISPLAYNODE_REQUIRES_SUPER; -/** - * @abstract Called when the node's ASTraitCollection changes - * - * @discussion Subclasses can override this method to react to a trait collection change. - */ -AS_CATEGORY_IMPLEMENTABLE -- (void)asyncTraitCollectionDidChange ASDISPLAYNODE_REQUIRES_SUPER ASDISPLAYNODE_DEPRECATED_MSG("Use asyncTraitCollectionDidChangeWithPreviousTraitCollection: instead."); - - /** * @abstract Called when the node's ASTraitCollection changes * * @discussion Subclasses can override this method to react to a trait collection change. * * @param previousTraitCollection The ASPrimitiveTraitCollection object before the interface environment changed. - * - * @note Enable `ASExperimentalTraitCollectionDidChangeWithPreviousCollection` experiment to have this method called instead of `asyncTraitCollectionDidChange`. */ AS_CATEGORY_IMPLEMENTABLE - (void)asyncTraitCollectionDidChangeWithPreviousTraitCollection:(ASPrimitiveTraitCollection)previousTraitCollection ASDISPLAYNODE_REQUIRES_SUPER; diff --git a/Source/ASDisplayNode.mm b/Source/ASDisplayNode.mm index 5b4e3b2ed..45f3df870 100644 --- a/Source/ASDisplayNode.mm +++ b/Source/ASDisplayNode.mm @@ -241,7 +241,6 @@ + (void)initialize class_addMethod(self, @selector(didEnterVisibleState), noArgsImp, "v@:"); class_addMethod(self, @selector(didExitVisibleState), noArgsImp, "v@:"); class_addMethod(self, @selector(hierarchyDisplayDidFinish), noArgsImp, "v@:"); - class_addMethod(self, @selector(asyncTraitCollectionDidChange), noArgsImp, "v@:"); class_addMethod(self, @selector(calculatedLayoutDidChange), noArgsImp, "v@:"); auto type0 = "v@:" + std::string(@encode(ASSizeRange)); diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 29939a556..306c57d41 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -28,8 +28,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) { ASExperimentalDispatchApply = 1 << 7, // exp_dispatch_apply ASExperimentalDrawingGlobal = 1 << 8, // exp_drawing_global ASExperimentalOptimizeDataControllerPipeline = 1 << 9, // exp_optimize_data_controller_pipeline - ASExperimentalTraitCollectionDidChangeWithPreviousCollection = 1 << 10, // exp_trait_collection_did_change_with_previous_collection - ASExperimentalDoNotCacheAccessibilityElements = 1 << 11 , // exp_do_not_cache_accessibility_elements + ASExperimentalDoNotCacheAccessibilityElements = 1 << 10, // exp_do_not_cache_accessibility_elements ASExperimentalFeatureAll = 0xFFFFFFFF }; diff --git a/Source/ASExperimentalFeatures.mm b/Source/ASExperimentalFeatures.mm index e89aebe46..fef124b45 100644 --- a/Source/ASExperimentalFeatures.mm +++ b/Source/ASExperimentalFeatures.mm @@ -22,7 +22,6 @@ @"exp_dispatch_apply", @"exp_drawing_global", @"exp_optimize_data_controller_pipeline", - @"exp_trait_collection_did_change_with_previous_collection", @"exp_do_not_cache_accessibility_elements"])); if (flags == ASExperimentalFeatureAll) { return allNames; diff --git a/Tests/ASConfigurationTests.mm b/Tests/ASConfigurationTests.mm index 083251adf..755375af8 100644 --- a/Tests/ASConfigurationTests.mm +++ b/Tests/ASConfigurationTests.mm @@ -28,7 +28,6 @@ ASExperimentalDispatchApply, ASExperimentalDrawingGlobal, ASExperimentalOptimizeDataControllerPipeline, - ASExperimentalTraitCollectionDidChangeWithPreviousCollection, ASExperimentalDoNotCacheAccessibilityElements, }; @@ -52,7 +51,6 @@ + (NSArray *)names { @"exp_dispatch_apply", @"exp_drawing_global", @"exp_optimize_data_controller_pipeline", - @"exp_trait_collection_did_change_with_previous_collection", @"exp_do_not_cache_accessibility_elements", ]; } diff --git a/Tests/ASDisplayNodeSnapshotTests.mm b/Tests/ASDisplayNodeSnapshotTests.mm index 07ebbc632..8cf7c6a6d 100644 --- a/Tests/ASDisplayNodeSnapshotTests.mm +++ b/Tests/ASDisplayNodeSnapshotTests.mm @@ -16,13 +16,6 @@ @interface ASDisplayNodeSnapshotTests : ASSnapshotTestCase @implementation ASDisplayNodeSnapshotTests -- (void)setUp { - [super setUp]; - ASConfiguration *config = [ASConfiguration new]; - config.experimentalFeatures = ASExperimentalTraitCollectionDidChangeWithPreviousCollection; - [ASConfigurationManager test_resetWithConfiguration:config]; -} - - (void)testBasicHierarchySnapshotTesting { ASDisplayNode *node = [[ASDisplayNode alloc] init]; @@ -68,14 +61,6 @@ - (void)testPrecompositedCornerRounding - (void)testClippingCornerRounding { -#if AS_AT_LEAST_IOS13 - if (@available(iOS 13.0, *)) { - ASConfiguration *config = [ASConfiguration new]; - config.experimentalFeatures = ASExperimentalTraitCollectionDidChangeWithPreviousCollection; - [ASConfigurationManager test_resetWithConfiguration:config]; - } -#endif - for (CACornerMask c = 1; c <= kASCACornerAllCorners; c |= (c << 1)) { auto node = [[ASImageNode alloc] init]; auto bounds = CGRectMake(0, 0, 100, 100); diff --git a/Tests/ASImageNodeSnapshotTests.mm b/Tests/ASImageNodeSnapshotTests.mm index 431e28d09..13364930b 100644 --- a/Tests/ASImageNodeSnapshotTests.mm +++ b/Tests/ASImageNodeSnapshotTests.mm @@ -242,11 +242,6 @@ - (void)testUIGraphicsRendererDrawingExperiment - (void)testDynamicAssetImage { if (@available(iOS 13.0, *)) { - // enable experimantal callback for traits change - ASConfiguration *config = [ASConfiguration new]; - config.experimentalFeatures = ASExperimentalTraitCollectionDidChangeWithPreviousCollection; - [ASConfigurationManager test_resetWithConfiguration:config]; - UIImage *image = [UIImage imageNamed:@"light-dark" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; ASImageNode *node = [[ASImageNode alloc] init]; node.image = image; @@ -265,11 +260,6 @@ - (void)testDynamicAssetImage - (void)testDynamicTintColor { if (@available(iOS 13.0, *)) { - // enable experimental callback for traits change - ASConfiguration *config = [ASConfiguration new]; - config.experimentalFeatures = ASExperimentalTraitCollectionDidChangeWithPreviousCollection; - [ASConfigurationManager test_resetWithConfiguration:config]; - UIImage *image = makeImageWithColor(UIColor.redColor, CGSize{.width = 100, .height = 100}); image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; UIColor* tintColor = UIColor.systemBackgroundColor;