Fix ASDISPLAYNODE_ASSERTIONS_ENABLED and ASDefaultPlaybackButton warnings #trivial (#880)

* Define ASDISPLAYNODE_ASSERTIONS_ENABLED explicitly

* Add parameter type for drawRect: in ASDefaultPlaybackButton
This commit is contained in:
Michael Schneider
2018-04-12 10:07:37 -07:00
committed by GitHub
parent 9d5857664f
commit 0aefbb65ba
2 changed files with 8 additions and 4 deletions

View File

@@ -21,7 +21,11 @@
#import <pthread.h>
#import <AsyncDisplayKit/ASBaseDefines.h>
#define ASDISPLAYNODE_ASSERTIONS_ENABLED (!defined(NS_BLOCK_ASSERTIONS))
#if !defined(NS_BLOCK_ASSERTIONS)
#define ASDISPLAYNODE_ASSERTIONS_ENABLED 1
#else
#define ASDISPLAYNODE_ASSERTIONS_ENABLED 0
#endif
/**
* Note: In some cases it would be sufficient to do e.g.:

View File

@@ -46,15 +46,15 @@
}
}
- (nullable id<NSObject>)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
- (nullable NSDictionary *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
{
return @{
@"buttonType" : [NSNumber numberWithInt:_buttonType],
@"buttonType" : @(self.buttonType),
@"color" : self.tintColor
};
}
+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
{
ASDefaultPlaybackButtonType buttonType = (ASDefaultPlaybackButtonType)[parameters[@"buttonType"] intValue];
UIColor *color = parameters[@"color"];