File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1243,34 +1243,34 @@ - (void)setX:(CGFloat)x alpha:(CGFloat)alpha {
12431243 self.alpha = alpha;
12441244}
12451245
1246+ - (void )defaultAnimate : (void (^)(void ))animations duration : (NSTimeInterval )seconds {
1247+ if (animations) {
1248+ [UIView animateWithDuration: seconds
1249+ delay: 0.0
1250+ options: UIViewAnimationOptionCurveEaseInOut
1251+ animations: ^{
1252+ animations ();
1253+ }
1254+ completion: nil ];
1255+ }
1256+ }
1257+
12461258- (void )animateX : (CGFloat)x alpha : (CGFloat)alpha duration : (NSTimeInterval )seconds {
1247- [UIView animateWithDuration: seconds
1248- delay: 0.0
1249- options: UIViewAnimationOptionCurveEaseInOut
1250- animations: ^{
1259+ [self defaultAnimate: ^{
12511260 [self setX: x alpha: alpha];
1252- }
1253- completion: nil ];
1261+ } duration: seconds];
12541262}
12551263
12561264- (void )animateOrigin : (CGPoint)origin duration : (NSTimeInterval )seconds {
1257- [UIView animateWithDuration: seconds
1258- delay: 0.0
1259- options: UIViewAnimationOptionCurveEaseInOut
1260- animations: ^{
1265+ [self defaultAnimate: ^{
12611266 [self setOrigin: origin];
1262- }
1263- completion: nil ];
1267+ } duration: seconds];
12641268}
12651269
12661270- (void )animateAlpha : (CGFloat)alpha duration : (NSTimeInterval )seconds {
1267- [UIView animateWithDuration: seconds
1268- delay: 0.0
1269- options: UIViewAnimationOptionCurveEaseInOut
1270- animations: ^{
1271+ [self defaultAnimate: ^{
12711272 self.alpha = alpha;
1272- }
1273- completion: nil ];
1273+ } duration: seconds];
12741274}
12751275
12761276- (void )setCornerRadiusForRoundedEdges {
You can’t perform that action at this time.
0 commit comments