Skip to content

Commit

Permalink
fix(ios): fix gradient checks for tailwind-based classes (#13548)
Browse files Browse the repository at this point in the history
  • Loading branch information
hansemannn committed Aug 29, 2022
1 parent bc3a5ef commit f0f73f6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m
Expand Up @@ -350,9 +350,14 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
// Redraw the background gradient
TiGradient *backgroundGradient = [self.proxy valueForKey:@"backgroundGradient"];
if (backgroundGradient != nil) {
[backgroundGradient clearCache];
[backgroundGradient setColors:[backgroundGradient valueForKey:@"colors"]];
[self setBackgroundGradient_:backgroundGradient];
// Guard the colors to handle a case where gradients have no custom
// colors applied
id colors = [backgroundGradient valueForKey:@"colors"];
if (colors != nil) {
[backgroundGradient clearCache];
[backgroundGradient setColors:colors];
[self setBackgroundGradient_:backgroundGradient];
}
}
}

Expand Down

0 comments on commit f0f73f6

Please sign in to comment.