Objective-C – CABasicAnimation applying changes after animation?

When you add an animation to a layer, the animation does not change the layer’s properties. Instead, the system creates a copy of the layer. The original layer is called the model layer, and the duplicate is called the presentation layer. The presentation layer’s properties change as the animation progresses, but the model layer’s properties … Read more

Fade In Fade Out Animation

When you call the fadeIn and fadeOut methods back to back like you’re doing, the code is run instantaneously, so you’ll only see animation from the last method called. UIView block based animation provides a completion handler, which seems to be exactly what you’re looking for. So your code might looks something like this: -(IBAction)startFade:(id)sender … Read more

CALayer: add a border only at one side

I made a right border using this: leftScrollView.clipsToBounds = YES; CALayer *rightBorder = [CALayer layer]; rightBorder.borderColor = [UIColor darkGrayColor].CGColor; rightBorder.borderWidth = 1; rightBorder.frame = CGRectMake(-1, -1, CGRectGetWidth(leftScrollView.frame), CGRectGetHeight(leftScrollView.frame)+2); [leftScrollView.layer addSublayer:rightBorder];

UIView animateWithDuration doesn’t animate cornerRadius variation

tl;dr: Corner radius is not animatable in animateWithDuration:animations:. What the documentation says about view animations. As the section on Animations in the “View Programming Guide for iOS” says Both UIKit and Core Animation provide support for animations, but the level of support provided by each technology varies. In UIKit, animations are performed using UIView objects … Read more

How is the relation between UIView’s clipsToBounds and CALayer’s masksToBounds?

They are different names because UIView and CALayer are different and have different terminology associated with them, but they are functionally equivalent. If you disassemble clipsToBounds you will see it just calls masksToBounds (disassembly from the simulator framework, so x86): -(BOOL)[UIView(Rendering) clipsToBounds] +0 3091938a 55 pushl %ebp +1 3091938b 89e5 movl %esp,%ebp +3 3091938d e800000000 … Read more

Animation End Callback for CALayer?

You could use a CATransaction, it has a completion block handler. [CATransaction begin]; CABasicAnimation *pathAnimation = [CABasicAnimation animationWithKeyPath:@”strokeEnd”]; [pathAnimation setDuration:1]; [pathAnimation setFromValue:[NSNumber numberWithFloat:0.0f]]; [pathAnimation setToValue:[NSNumber numberWithFloat:1.0f]]; [CATransaction setCompletionBlock:^{_lastPoint = _currentPoint; _currentPoint = CGPointMake(_lastPoint.x + _wormStepHorizontalValue, _wormStepVerticalValue);}]; [_pathLayer addAnimation:pathAnimation forKey:@”strokeEnd”]; [CATransaction commit];

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)