mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Fix crash accessing automaticallyAdjustRangeModeBasedOnViewEvents property in ASViewController
This commit is contained in:
@@ -16,10 +16,9 @@
|
||||
@implementation ASViewController
|
||||
{
|
||||
BOOL _ensureDisplayed;
|
||||
BOOL _automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
}
|
||||
|
||||
@synthesize automaticallyAdjustsScrollViewInsets = _automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
|
||||
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
||||
{
|
||||
ASDisplayNodeAssert(NO, @"ASViewController requires using -initWithNode:");
|
||||
@@ -86,9 +85,19 @@
|
||||
|
||||
#pragma mark - Automatic range mode
|
||||
|
||||
- (BOOL)automaticallyAdjustRangeModeBasedOnViewEvents
|
||||
{
|
||||
return _automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
}
|
||||
|
||||
- (void)setAutomaticallyAdjustRangeModeBasedOnViewEvents:(BOOL)automaticallyAdjustRangeModeBasedOnViewEvents
|
||||
{
|
||||
_automaticallyAdjustRangeModeBasedOnViewEvents = automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
}
|
||||
|
||||
- (void)updateCurrentRangeModeWithModeIfPossible:(ASLayoutRangeMode)rangeMode
|
||||
{
|
||||
if (!self.automaticallyAdjustRangeModeBasedOnViewEvents) { return; }
|
||||
if (!_automaticallyAdjustRangeModeBasedOnViewEvents) { return; }
|
||||
if (![_node conformsToProtocol:@protocol(ASRangeControllerUpdateRangeProtocol)]) { return; }
|
||||
|
||||
id<ASRangeControllerUpdateRangeProtocol> updateRangeNode = (id<ASRangeControllerUpdateRangeProtocol>)_node;
|
||||
|
||||
Reference in New Issue
Block a user