Skip to content

Commit c62f42c

Browse files
author
Paul Colton
committed
when styling non-recursively, still update virtual children
1 parent 2d30d95 commit c62f42c

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/Core/Styling/Categories/UIView+PXStyling.m

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -445,22 +445,19 @@ + (void)updateStyles:(id<PXStyleable>)styleable recursively:(bool)recurse
445445
{
446446
if (styleable.styleMode == PXStylingNormal)
447447
{
448-
if(recurse)
448+
for (id<PXStyleable> child in styleable.pxStyleChildren)
449449
{
450-
for (id<PXStyleable> child in styleable.pxStyleChildren)
450+
if ([child conformsToProtocol:@protocol(PXVirtualControl)] && child.styleMode == PXStylingNormal)
451451
{
452-
if ([child conformsToProtocol:@protocol(PXVirtualControl)] && child.styleMode == PXStylingNormal)
452+
[PXStyleUtils enumerateStyleableDescendants:child usingBlock:^(id<PXStyleable> styleable, BOOL *stop, BOOL *stopDescending)
453453
{
454-
[PXStyleUtils enumerateStyleableDescendants:child usingBlock:^(id<PXStyleable> styleable, BOOL *stop, BOOL *stopDescending)
454+
if ([styleable conformsToProtocol:@protocol(PXVirtualControl)] && styleable.styleMode == PXStylingNormal)
455455
{
456-
if ([styleable conformsToProtocol:@protocol(PXVirtualControl)] && styleable.styleMode == PXStylingNormal)
457-
{
458-
[PXStyleUtils updateStyleForStyleable:styleable];
459-
}
460-
}];
461-
462-
[PXStyleUtils updateStyleForStyleable:child];
463-
}
456+
[PXStyleUtils updateStyleForStyleable:styleable];
457+
}
458+
}];
459+
460+
[PXStyleUtils updateStyleForStyleable:child];
464461
}
465462
}
466463

0 commit comments

Comments
 (0)