From d6f09887db79a85fb66bc7214bb07d9d54d3504e Mon Sep 17 00:00:00 2001 From: Jeyaram Jeyaraj Date: Wed, 26 Apr 2017 18:54:56 -0700 Subject: [PATCH] Fix UINavigationBar and UITableViewCell to use CGColor --- Frameworks/UIKit/UINavigationBar.mm | 4 ++-- Frameworks/UIKit/UITableViewCell.mm | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Frameworks/UIKit/UINavigationBar.mm b/Frameworks/UIKit/UINavigationBar.mm index 06706aee43..85aade7746 100644 --- a/Frameworks/UIKit/UINavigationBar.mm +++ b/Frameworks/UIKit/UINavigationBar.mm @@ -146,7 +146,7 @@ - (instancetype)initWithFrame:(CGRect)pos { [super initWithFrame:pos]; - [[self layer] setBackgroundColor:(CGColorRef)[UIColor whiteColor]]; + [[self layer] setBackgroundColor:CGColorGetConstantColor(kCGColorWhite)]; _font = [UIFont boldSystemFontOfSize:18]; (_backButton) .attach([[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:self action:@selector(backClicked)]); @@ -653,7 +653,7 @@ - (void)setBarTintColor:(UIColor*)color { size.height = 10.0f; UIGraphicsBeginImageContextWithOptions(size, 1, 2.0f); CGContextRef ctx = UIGraphicsGetCurrentContext(); - CGContextSetFillColorWithColor(ctx, (CGColorRef)(UIColor*)_barTintColor); + CGContextSetFillColorWithColor(ctx, [(UIColor*)_barTintColor CGColor]); CGRect rct = { 0, 0, 0, 0 }; rct.size = size; CGContextFillRect(ctx, rct); diff --git a/Frameworks/UIKit/UITableViewCell.mm b/Frameworks/UIKit/UITableViewCell.mm index a0887ae3a6..57273b0cc9 100644 --- a/Frameworks/UIKit/UITableViewCell.mm +++ b/Frameworks/UIKit/UITableViewCell.mm @@ -1090,10 +1090,11 @@ - (void)dealloc { - (void)_addBottomBorder:(UITableView*)parentTable { if (_borderView == nil) { - const __CGColorQuad* color = [[parentTable backgroundColor] _getColors]; + const CGFloat* color = CGColorGetComponents([[parentTable backgroundColor] CGColor]); + UIColor* backgroundColor = nil; - if ((color == nullptr) || (color->a == 0.0f) || (color->r == 1.0f && color->g == 1.0f && color->b == 1.0f && color->a == 1.0f)) { + if ((color == nullptr) || (color[3] == 0.0f) || (color[0] == 1.0f && color[1] == 1.0f && color[2] == 1.0f && color[3] == 1.0f)) { backgroundColor = [UIColor grayColor]; } else { backgroundColor = [UIColor whiteColor];