mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-20 13:19:16 +00:00
Merge pull request #1867 from maicki/MSFixXcode8Errors
Fix Xcode 8 Errors
This commit is contained in:
commit
b3d673645d
@ -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];
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user