mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASViewController] Defer range update conformance check until the actual range update
This commit is contained in:
@@ -175,7 +175,13 @@ ASVisibilityDepthImplementation;
|
||||
- (void)setAutomaticallyAdjustRangeModeBasedOnViewEvents:(BOOL)automaticallyAdjustRangeModeBasedOnViewEvents
|
||||
{
|
||||
_automaticallyAdjustRangeModeBasedOnViewEvents = automaticallyAdjustRangeModeBasedOnViewEvents;
|
||||
if (automaticallyAdjustRangeModeBasedOnViewEvents && !_didCheckRangeModeProtocolConformance) {
|
||||
}
|
||||
|
||||
- (void)updateCurrentRangeModeWithModeIfPossible:(ASLayoutRangeMode)rangeMode
|
||||
{
|
||||
if (!_automaticallyAdjustRangeModeBasedOnViewEvents) { return; }
|
||||
|
||||
if (!_didCheckRangeModeProtocolConformance) {
|
||||
_selfConformsToRangeModeProtocol = [self conformsToProtocol:@protocol(ASRangeControllerUpdateRangeProtocol)];
|
||||
_nodeConformsToRangeModeProtocol = [_node conformsToProtocol:@protocol(ASRangeControllerUpdateRangeProtocol)];
|
||||
_didCheckRangeModeProtocolConformance = YES;
|
||||
@@ -183,11 +189,6 @@ ASVisibilityDepthImplementation;
|
||||
NSLog(@"Warning: automaticallyAdjustRangeModeBasedOnViewEvents set to YES in %@, but range mode updating is not possible because neither view controller nor node %@ conform to ASRangeControllerUpdateRangeProtocol.", self, _node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateCurrentRangeModeWithModeIfPossible:(ASLayoutRangeMode)rangeMode
|
||||
{
|
||||
if (!_automaticallyAdjustRangeModeBasedOnViewEvents) { return; }
|
||||
|
||||
if (_selfConformsToRangeModeProtocol) {
|
||||
id<ASRangeControllerUpdateRangeProtocol> rangeUpdater = (id<ASRangeControllerUpdateRangeProtocol>)self;
|
||||
|
||||
Reference in New Issue
Block a user