Merge pull request #1867 from maicki/MSFixXcode8Errors

Fix Xcode 8 Errors
This commit is contained in:
Adlai Holler 2016-07-08 12:42:50 -07:00 committed by GitHub
commit b3d673645d
3 changed files with 16 additions and 8 deletions

View File

@ -39,6 +39,10 @@ NSInteger const ASDefaultDrawingPriority = ASDefaultTransactionPriority;
NSString * const ASRenderingEngineDidDisplayScheduledNodesNotification = @"ASRenderingEngineDidDisplayScheduledNodes";
NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp = @"ASRenderingEngineDidDisplayNodesScheduledBeforeTimestamp";
// Forward declare CALayerDelegate protocol as the iOS 10 SDK moves CALayerDelegate from a formal delegate to a protocol.
// We have to forward declare the protocol as this place otherwise it will not compile compiling with an Base SDK < iOS 10
@protocol CALayerDelegate;
@interface ASDisplayNode () <UIGestureRecognizerDelegate, _ASDisplayLayerDelegate, _ASTransitionContextCompletionDelegate>
/**
@ -493,7 +497,8 @@ static ASDisplayNodeMethodOverrides GetASDisplayNodeMethodOverrides(Class c)
if (isLayerBacked) {
TIME_SCOPED(_debugTimeToCreateView);
_layer = [self _layerToLoad];
_layer.delegate = self;
// Surpress warning for Base SDK > 10.0
_layer.delegate = (id<CALayerDelegate>)self;
} else {
TIME_SCOPED(_debugTimeToCreateView);
_view = [self _viewToLoad];

View File

@ -223,9 +223,12 @@ NSAttributedString *ASCleanseAttributedStringOfCoreTextAttributes(NSAttributedSt
// kCTParagraphStyleSpecifierLineSpacing -> lineSpacing
// Note that kCTParagraphStyleSpecifierLineSpacing is deprecated and will die soon. We should not be using it.
CGFloat lineSpacing;
if (CTParagraphStyleGetValueForSpecifier(coreTextParagraphStyle, kCTParagraphStyleSpecifierLineSpacing, sizeof(lineSpacing), &lineSpacing))
newParagraphStyle.lineSpacing = lineSpacing;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGFloat lineSpacing;
if (CTParagraphStyleGetValueForSpecifier(coreTextParagraphStyle, kCTParagraphStyleSpecifierLineSpacing, sizeof(lineSpacing), &lineSpacing))
newParagraphStyle.lineSpacing = lineSpacing;
#pragma clang diagnostic pop
// kCTParagraphStyleSpecifierParagraphSpacing -> paragraphSpacing
CGFloat paragraphSpacing;

View File

@ -160,7 +160,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\
@end
@interface UIResponderNodeTestView : _ASDisplayView
@property(nonatomic) BOOL isFirstResponder;
@property(nonatomic) BOOL testIsFirstResponder;
@end
@implementation UIDisplayNodeTestView
@ -192,7 +192,7 @@ for (ASDisplayNode *n in @[ nodes ]) {\
@implementation UIResponderNodeTestView
- (BOOL)becomeFirstResponder {
self.isFirstResponder = YES;
self.testIsFirstResponder = YES;
return YES;
}
@ -202,8 +202,8 @@ for (ASDisplayNode *n in @[ nodes ]) {\
- (BOOL)resignFirstResponder {
[super resignFirstResponder];
if (self.isFirstResponder) {
self.isFirstResponder = NO;
if (self.testIsFirstResponder) {
self.testIsFirstResponder = NO;
return YES;
}
return NO;