Skip to content

Commit

Permalink
Fix project coding warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hanton committed Jul 12, 2019
1 parent 7da85c5 commit 6dda57c
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 33 deletions.
1 change: 0 additions & 1 deletion examples/ASDKTube/Sample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[[UINavigationBar appearance] setBarTintColor:[UIColor lighOrangeColor]];
[[UINavigationBar appearance] setTranslucent:NO];

[application setStatusBarStyle:UIStatusBarStyleLightContent];


return YES;
Expand Down
5 changes: 5 additions & 0 deletions examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ - (void)viewDidLoad
[_tableNode reloadData];
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}

- (void)generateFeedData
{
_videoFeedData = [[NSMutableArray alloc] init];
Expand Down
8 changes: 6 additions & 2 deletions examples/ASDKgram/Sample/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

NS_ASSUME_NONNULL_BEGIN

@interface UIColor (Additions)

+ (UIColor *)backgroundColor;
Expand All @@ -33,7 +35,9 @@

+ (NSAttributedString *)attributedStringWithString:(NSString *)string
fontSize:(CGFloat)size
color:(UIColor *)color
firstWordColor:(UIColor *)firstWordColor;
color:(nullable UIColor *)color
firstWordColor:(nullable UIColor *)firstWordColor;

@end

NS_ASSUME_NONNULL_END
8 changes: 4 additions & 4 deletions examples/CatDealsCollectionView/Sample/ItemViewModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ - (instancetype)init
_identifier = atomic_fetch_add(&nextID, 1);
_titleText = [self randomObjectFromArray:titles];
_firstInfoText = [self randomObjectFromArray:firstInfos];
_secondInfoText = [NSString stringWithFormat:@"%zd+ bought", [self randomNumberInRange:5 to:6000]];
_originalPriceText = [NSString stringWithFormat:@"$%zd", [self randomNumberInRange:40 to:90]];
_finalPriceText = [NSString stringWithFormat:@"$%zd", [self randomNumberInRange:5 to:30]];
_secondInfoText = [NSString stringWithFormat:@"%u+ bought", [self randomNumberInRange:5 to:6000]];
_originalPriceText = [NSString stringWithFormat:@"$%u", [self randomNumberInRange:40 to:90]];
_finalPriceText = [NSString stringWithFormat:@"$%u", [self randomNumberInRange:5 to:30]];
_soldOutText = (arc4random() % 5 == 0) ? @"SOLD OUT" : nil;
_distanceLabelText = [NSString stringWithFormat:@"%zd mi", [self randomNumberInRange:1 to:20]];
_distanceLabelText = [NSString stringWithFormat:@"%u mi", [self randomNumberInRange:1 to:20]];
if (arc4random() % 2 == 0) {
_badgeText = [self randomObjectFromArray:badges];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)layout
{
[super layout];

_collectionNode.view.contentInset = UIEdgeInsetsMake(0.0, kOuterPadding, 0.0, kOuterPadding);
_collectionNode.contentInset = UIEdgeInsetsMake(0.0, kOuterPadding, 0.0, kOuterPadding);

// Manually layout the divider.
CGFloat pixelHeight = 1.0f / [[UIScreen mainScreen] scale];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ + (UIColor *)randomColor
return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];
}

+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
{
CGFloat locations[3];
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3];
Expand Down
2 changes: 1 addition & 1 deletion examples/SocialAppLayout-Inverted/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ - (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
CGFloat inset = [self topBarsHeight];
self.tableNode.view.contentInset = UIEdgeInsetsMake(-inset, 0, inset, 0);
self.tableNode.contentInset = UIEdgeInsetsMake(-inset, 0, inset, 0);
self.tableNode.view.scrollIndicatorInsets = UIEdgeInsetsMake(-inset, 0, inset, 0);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ - (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSInde
{
RandomCoreGraphicsNode *elementNode = [[RandomCoreGraphicsNode alloc] init];
elementNode.style.preferredSize = _elementSize;
elementNode.indexPath = [NSIndexPath indexPathForRow:indexPath.row inSection:_pageNumber];
NSString *content = [[NSIndexPath indexPathForRow:indexPath.row inSection:_pageNumber] description];
[elementNode setContent:content];

return elementNode;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
#import <AsyncDisplayKit/AsyncDisplayKit.h>

@interface RandomCoreGraphicsNode : ASCellNode
{
ASTextNode *_indexPathTextNode;
}

@property NSIndexPath *indexPath;
- (void)setContent:(NSString *)content;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#import "RandomCoreGraphicsNode.h"
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>

@implementation RandomCoreGraphicsNode

@synthesize indexPath = _indexPath;
@implementation RandomCoreGraphicsNode {
ASTextNode *_indexPathTextNode;
}

+ (UIColor *)randomColor
{
Expand All @@ -22,7 +22,7 @@ + (UIColor *)randomColor
return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1];
}

+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ (void)drawRect:(CGRect)bounds withParameters:(id<NSObject>)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
{
CGFloat locations[3];
NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3];
Expand Down Expand Up @@ -56,21 +56,9 @@ - (instancetype)init
return self;
}

- (void)setIndexPath:(NSIndexPath *)indexPath
- (void)setContent:(NSString *)content
{
@synchronized (self) {
_indexPath = indexPath;
_indexPathTextNode.attributedText = [[NSAttributedString alloc] initWithString:[indexPath description] attributes:nil];
}
}

- (NSIndexPath *)indexPath
{
NSIndexPath *indexPath = nil;
@synchronized (self) {
indexPath = _indexPath;
}
return indexPath;
_indexPathTextNode.attributedText = [[NSAttributedString alloc] initWithString:content attributes:nil];
}

- (void)layout
Expand Down

0 comments on commit 6dda57c

Please sign in to comment.