Skip to content

Commit

Permalink
when styling non-recursively, still update virtual children
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Colton committed Mar 20, 2014
1 parent 2d30d95 commit c62f42c
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/Core/Styling/Categories/UIView+PXStyling.m
Original file line number Diff line number Diff line change
Expand Up @@ -445,22 +445,19 @@ + (void)updateStyles:(id<PXStyleable>)styleable recursively:(bool)recurse
{
if (styleable.styleMode == PXStylingNormal)
{
if(recurse)
for (id<PXStyleable> child in styleable.pxStyleChildren)
{
for (id<PXStyleable> child in styleable.pxStyleChildren)
if ([child conformsToProtocol:@protocol(PXVirtualControl)] && child.styleMode == PXStylingNormal)
{
if ([child conformsToProtocol:@protocol(PXVirtualControl)] && child.styleMode == PXStylingNormal)
[PXStyleUtils enumerateStyleableDescendants:child usingBlock:^(id<PXStyleable> styleable, BOOL *stop, BOOL *stopDescending)
{
[PXStyleUtils enumerateStyleableDescendants:child usingBlock:^(id<PXStyleable> styleable, BOOL *stop, BOOL *stopDescending)
if ([styleable conformsToProtocol:@protocol(PXVirtualControl)] && styleable.styleMode == PXStylingNormal)
{
if ([styleable conformsToProtocol:@protocol(PXVirtualControl)] && styleable.styleMode == PXStylingNormal)
{
[PXStyleUtils updateStyleForStyleable:styleable];
}
}];

[PXStyleUtils updateStyleForStyleable:child];
}
[PXStyleUtils updateStyleForStyleable:styleable];
}
}];

[PXStyleUtils updateStyleForStyleable:child];
}
}

Expand Down

1 comment on commit c62f42c

@wprater
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, this fixes issue #84 for me!

Please sign in to comment.