diff --git a/examples/ASDKTube/Sample/AppDelegate.m b/examples/ASDKTube/Sample/AppDelegate.m index 9ceabb213..e08d31229 100644 --- a/examples/ASDKTube/Sample/AppDelegate.m +++ b/examples/ASDKTube/Sample/AppDelegate.m @@ -35,7 +35,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( [[UINavigationBar appearance] setBarTintColor:[UIColor lighOrangeColor]]; [[UINavigationBar appearance] setTranslucent:NO]; - [application setStatusBarStyle:UIStatusBarStyleLightContent]; return YES; diff --git a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m index b6e53ba7a..93f78d440 100644 --- a/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m +++ b/examples/ASDKTube/Sample/Controller/VideoFeedNodeController.m @@ -45,6 +45,11 @@ - (void)viewDidLoad [_tableNode reloadData]; } +- (UIStatusBarStyle)preferredStatusBarStyle +{ + return UIStatusBarStyleLightContent; +} + - (void)generateFeedData { _videoFeedData = [[NSMutableArray alloc] init]; diff --git a/examples/ASDKgram/Sample/Utilities.h b/examples/ASDKgram/Sample/Utilities.h index 803f6a62f..2d3f11c49 100644 --- a/examples/ASDKgram/Sample/Utilities.h +++ b/examples/ASDKgram/Sample/Utilities.h @@ -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; @@ -32,8 +34,10 @@ @interface NSAttributedString (Additions) + (NSAttributedString *)attributedStringWithString:(NSString *)string - fontSize:(CGFloat)size - color:(UIColor *)color - firstWordColor:(UIColor *)firstWordColor; + fontSize:(CGFloat)size + color:(nullable UIColor *)color + firstWordColor:(nullable UIColor *)firstWordColor; @end + +NS_ASSUME_NONNULL_END diff --git a/examples/CatDealsCollectionView/Sample/ItemViewModel.m b/examples/CatDealsCollectionView/Sample/ItemViewModel.m index 8f60900c6..83a7980bd 100644 --- a/examples/CatDealsCollectionView/Sample/ItemViewModel.m +++ b/examples/CatDealsCollectionView/Sample/ItemViewModel.m @@ -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]; } diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm index 079464389..d2b325cc6 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm +++ b/examples/HorizontalWithinVerticalScrolling/Sample/HorizontalScrollCellNode.mm @@ -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]; diff --git a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m index 83d9ed679..3650616c9 100644 --- a/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/HorizontalWithinVerticalScrolling/Sample/RandomCoreGraphicsNode.m @@ -20,7 +20,7 @@ + (UIColor *)randomColor return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; } -+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing ++ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing { CGFloat locations[3]; NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3]; diff --git a/examples/SocialAppLayout-Inverted/Sample/ViewController.m b/examples/SocialAppLayout-Inverted/Sample/ViewController.m index efc9d06e4..eeabc147e 100644 --- a/examples/SocialAppLayout-Inverted/Sample/ViewController.m +++ b/examples/SocialAppLayout-Inverted/Sample/ViewController.m @@ -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); } diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm index af36ca637..1a076abbe 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm +++ b/examples/VerticalWithinHorizontalScrolling/Sample/GradientTableNode.mm @@ -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; } diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h index c07752ab1..b270277c1 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.h @@ -10,10 +10,7 @@ #import @interface RandomCoreGraphicsNode : ASCellNode -{ - ASTextNode *_indexPathTextNode; -} -@property NSIndexPath *indexPath; +- (void)setContent:(NSString *)content; @end diff --git a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m index bf114349e..eeb1b5b22 100644 --- a/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m +++ b/examples/VerticalWithinHorizontalScrolling/Sample/RandomCoreGraphicsNode.m @@ -10,9 +10,9 @@ #import "RandomCoreGraphicsNode.h" #import -@implementation RandomCoreGraphicsNode - -@synthesize indexPath = _indexPath; +@implementation RandomCoreGraphicsNode { + ASTextNode *_indexPathTextNode; +} + (UIColor *)randomColor { @@ -22,7 +22,7 @@ + (UIColor *)randomColor return [UIColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1]; } -+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing ++ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing { CGFloat locations[3]; NSMutableArray *colors = [NSMutableArray arrayWithCapacity:3]; @@ -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