86
86
int setLayoutMargins:1 ;
87
87
int setPreservesSuperviewLayoutMargins:1 ;
88
88
int setInsetsLayoutMarginsFromSafeArea:1 ;
89
- int setActions:1 ;
90
89
int setMaskedCorners : 1 ;
91
90
} ASPendingStateFlags;
92
91
93
-
94
- static constexpr ASPendingStateFlags kZeroFlags = {0 };
95
-
96
92
@implementation _ASPendingState
97
93
{
98
94
@package // Expose all ivars for ASDisplayNode to bypass getters for efficiency
@@ -145,7 +141,6 @@ @implementation _ASPendingState
145
141
CGPoint accessibilityActivationPoint;
146
142
UIBezierPath *accessibilityPath;
147
143
UISemanticContentAttribute semanticContentAttribute API_AVAILABLE (ios (9.0 ), tvos (9.0 ));
148
- NSDictionary <NSString *, id <CAAction >> *actions;
149
144
150
145
ASPendingStateFlags _flags;
151
146
}
@@ -215,8 +210,11 @@ ASDISPLAYNODE_INLINE void ASPendingStateApplyMetricsToLayer(_ASPendingState *sta
215
210
@synthesize layoutMargins=layoutMargins;
216
211
@synthesize preservesSuperviewLayoutMargins=preservesSuperviewLayoutMargins;
217
212
@synthesize insetsLayoutMarginsFromSafeArea=insetsLayoutMarginsFromSafeArea;
213
+ <<<<<<< HEAD
218
214
@synthesize actions=actions;
219
215
@synthesize maskedCorners = maskedCorners;
216
+ =======
217
+ >>>>>>> parent of 34f16217... Add layer-action support to nodes (#1396 )
220
218
221
219
static CGColorRef blackColorRef = NULL;
222
220
static UIColor *defaultTintColor = nil ;
@@ -600,12 +598,6 @@ - (void)setSemanticContentAttribute:(UISemanticContentAttribute)attribute API_AV
600
598
_flags.setSemanticContentAttribute = YES ;
601
599
}
602
600
603
- - (void )setActions : (NSDictionary <NSString *,id<CAAction >> *)actionsArg
604
- {
605
- actions = [actionsArg copy ];
606
- _flags.setActions = YES ;
607
- }
608
-
609
601
- (BOOL )isAccessibilityElement
610
602
{
611
603
return isAccessibilityElement;
@@ -943,9 +935,6 @@ - (void)applyToLayer:(CALayer *)layer
943
935
if (flags.setOpaque )
944
936
ASDisplayNodeAssert (layer.opaque == opaque, @" Didn't set opaque as desired" );
945
937
946
- if (flags.setActions )
947
- layer.actions = actions;
948
-
949
938
ASPendingStateApplyMetricsToLayer (self, layer);
950
939
951
940
if (flags.needsLayout )
@@ -965,7 +954,7 @@ - (void)applyToView:(UIView *)view withSpecialPropertiesHandling:(BOOL)specialPr
965
954
because a different setter would be called.
966
955
*/
967
956
968
- unowned CALayer *layer = view.layer ;
957
+ CALayer *layer = view.layer ;
969
958
970
959
ASPendingStateFlags flags = _flags;
971
960
if (__shouldSetNeedsDisplay (layer)) {
@@ -1008,9 +997,6 @@ - (void)applyToView:(UIView *)view withSpecialPropertiesHandling:(BOOL)specialPr
1008
997
if (flags.setRasterizationScale )
1009
998
layer.rasterizationScale = rasterizationScale;
1010
999
1011
- if (flags.setActions )
1012
- layer.actions = actions;
1013
-
1014
1000
if (flags.setClipsToBounds )
1015
1001
view.clipsToBounds = clipsToBounds;
1016
1002
@@ -1304,7 +1290,7 @@ + (_ASPendingState *)pendingViewStateFromView:(UIView *)view
1304
1290
1305
1291
- (void )clearChanges
1306
1292
{
1307
- _flags = kZeroFlags ;
1293
+ _flags = (ASPendingStateFlags){ 0 } ;
1308
1294
}
1309
1295
1310
1296
- (BOOL )hasSetNeedsLayout
@@ -1319,7 +1305,69 @@ - (BOOL)hasSetNeedsDisplay
1319
1305
1320
1306
- (BOOL )hasChanges
1321
1307
{
1322
- return memcmp (&_flags, &kZeroFlags , sizeof (ASPendingStateFlags));
1308
+ ASPendingStateFlags flags = _flags;
1309
+
1310
+ return (flags.setAnchorPoint
1311
+ || flags.setPosition
1312
+ || flags.setZPosition
1313
+ || flags.setFrame
1314
+ || flags.setBounds
1315
+ || flags.setPosition
1316
+ || flags.setTransform
1317
+ || flags.setSublayerTransform
1318
+ || flags.setContents
1319
+ || flags.setContentsGravity
1320
+ || flags.setContentsRect
1321
+ || flags.setContentsCenter
1322
+ || flags.setContentsScale
1323
+ || flags.setRasterizationScale
1324
+ || flags.setClipsToBounds
1325
+ || flags.setBackgroundColor
1326
+ || flags.setTintColor
1327
+ || flags.setHidden
1328
+ || flags.setAlpha
1329
+ || flags.setCornerRadius
1330
+ || flags.setContentMode
1331
+ || flags.setUserInteractionEnabled
1332
+ || flags.setExclusiveTouch
1333
+ || flags.setShadowOpacity
1334
+ || flags.setShadowOffset
1335
+ || flags.setShadowRadius
1336
+ || flags.setShadowColor
1337
+ || flags.setBorderWidth
1338
+ || flags.setBorderColor
1339
+ || flags.setAutoresizingMask
1340
+ || flags.setAutoresizesSubviews
1341
+ || flags.setNeedsDisplayOnBoundsChange
1342
+ || flags.setAllowsGroupOpacity
1343
+ || flags.setAllowsEdgeAntialiasing
1344
+ || flags.setEdgeAntialiasingMask
1345
+ || flags.needsDisplay
1346
+ || flags.needsLayout
1347
+ || flags.setAsyncTransactionContainer
1348
+ || flags.setOpaque
1349
+ || flags.setSemanticContentAttribute
1350
+ || flags.setLayoutMargins
1351
+ || flags.setPreservesSuperviewLayoutMargins
1352
+ || flags.setInsetsLayoutMarginsFromSafeArea
1353
+ || flags.setIsAccessibilityElement
1354
+ || flags.setAccessibilityLabel
1355
+ || flags.setAccessibilityAttributedLabel
1356
+ || flags.setAccessibilityHint
1357
+ || flags.setAccessibilityAttributedHint
1358
+ || flags.setAccessibilityValue
1359
+ || flags.setAccessibilityAttributedValue
1360
+ || flags.setAccessibilityTraits
1361
+ || flags.setAccessibilityFrame
1362
+ || flags.setAccessibilityLanguage
1363
+ || flags.setAccessibilityElementsHidden
1364
+ || flags.setAccessibilityViewIsModal
1365
+ || flags.setShouldGroupAccessibilityChildren
1366
+ || flags.setAccessibilityIdentifier
1367
+ || flags.setAccessibilityNavigationStyle
1368
+ || flags.setAccessibilityHeaderElements
1369
+ || flags.setAccessibilityActivationPoint
1370
+ || flags.setAccessibilityPath );
1323
1371
}
1324
1372
1325
1373
- (void )dealloc
0 commit comments