Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provides a visual of the color for all UIColor objects.
- Loading branch information
1 parent
693f57e
commit 24d5f3e
Showing
6 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// FLEXColorExplorerViewController.h | ||
// | ||
// Created by Tanner on 10/18/18. | ||
// Copyright © 2018 Flipboard. All rights reserved. | ||
// | ||
|
||
#import "FLEXObjectExplorerViewController.h" | ||
|
||
@interface FLEXColorExplorerViewController : FLEXObjectExplorerViewController | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// FLEXColorExplorerViewController.m | ||
// | ||
// Created by Tanner on 10/18/18. | ||
// Copyright © 2018 Flipboard. All rights reserved. | ||
// | ||
|
||
#import "FLEXColorExplorerViewController.h" | ||
|
||
@interface FLEXColorExplorerViewController () | ||
|
||
@end | ||
|
||
@implementation FLEXColorExplorerViewController | ||
|
||
- (BOOL)shouldShowDescription | ||
{ | ||
return NO; | ||
} | ||
|
||
- (NSString *)customSectionTitle | ||
{ | ||
return @"Color"; | ||
} | ||
|
||
- (NSArray *)customSectionRowCookies | ||
{ | ||
return @[@0]; | ||
} | ||
|
||
- (UIView *)customViewForRowCookie:(id)rowCookie | ||
{ | ||
CGFloat width = [UIScreen mainScreen].bounds.size.width; | ||
UIView *square = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, 44)]; | ||
square.backgroundColor = (UIColor *)self.object; | ||
return square; | ||
} | ||
|
||
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | ||
// UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath]; | ||
// if (indexPath.section == 0 && indexPath.row == 0) { | ||
// cell.contentView.backgroundColor = (UIColor *)self.object; | ||
// } | ||
// | ||
// return cell; | ||
//} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24d5f3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When is this presented?
24d5f3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When viewing a color object (so, not when you tap on a mutable color property)
Looks like this
24d5f3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And how do you get to a color object if not through a view's property?
24d5f3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all properties are readwrite 😉 Calling methods and using the heap explorer could also take you here.