Disable action in a begin-commit scope

Disable action in a begin-commit scope
This commit is contained in:
Wenchao Ding 2016-05-03 15:56:49 +08:00
parent d7ac4c9fd0
commit 027b2d534c
2 changed files with 4 additions and 4 deletions

View File

@ -372,10 +372,10 @@ typedef NS_ENUM(NSUInteger, FSCalendarOrientation) {
if (_needsAdjustingMonthPosition) {
_needsAdjustingMonthPosition = NO;
_supressEvent = NO;
BOOL oldValue = [CATransaction disableActions];
[CATransaction begin];
[CATransaction setDisableActions:YES];
[self scrollToPageForDate:_pagingEnabled?_currentPage:(_currentPage?:self.selectedDate) animated:NO];
[CATransaction setDisableActions:oldValue];
[CATransaction commit];
}
}

View File

@ -198,7 +198,7 @@
[self performAlphaAnimationFrom:0 to:1 duration:0.4 exception:focusedRowNumber];
CGFloat duration = 0.3;
BOOL oldDisableActions = [CATransaction disableActions];
[CATransaction begin];
[CATransaction setDisableActions:NO];
[self performPathAnimationFrom:self.calendar.maskLayer.path to:[UIBezierPath bezierPathWithRect:targetBounds].CGPath duration:duration completion:^{
@ -220,7 +220,7 @@
[self boundingRectWillChange:targetBounds animated:animated];
[UIView commitAnimations];
}
[CATransaction setDisableActions:oldDisableActions];
[CATransaction commit];
} else {