caanimation

Rotating CAShapeLayer moves the position too

北城以北 提交于 2019-11-30 23:13:42
问题 I am creating a CAShapeLayer. I am adding rotation animation to it. Somehow transformation result is weird. The child layer is moving along with rotation. I need it to be in fixed center/position(anchor) and rotate. I know its messing up geometric transformation but i am unable to get it right. I have tried setting anchorpoint. I also followed this post Here is the code: UIBezierPath *circle = [UIBezierPath bezierPathWithArcCenter:CGPointMake(75, 125) radius:50 startAngle:0 endAngle:1.8 * M

How to split out multiple animations from Collada file in SceneKit

倖福魔咒の 提交于 2019-11-30 20:56:18
I am loading a third-party .dae Collada file as a scene into a SceneKit project. The .dae file has many different animations in it, set at different times/frames. I am trying to figure out how I can split these out and reference each individual animation by reference name. There are no intelligible reference names in the dae file - the animations are all set as one single animation. I am able to parse out the animations into a CAAnimation object, and verify that I have successfully done so with the following code: SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/man.dae"]; SCNNode *man =

UIBezierPath + CAShapeLayer - animate a circle filling up [duplicate]

我的未来我决定 提交于 2019-11-30 10:26:21
This question already has an answer here: Draw part of a circle 8 answers iPhone Core Animation - Drawing a Circle 4 answers iOS: How to draw a circle step by step with NSTimer 2 answers I am trying to animate the paths of a CAShapeLayer so that I get the effect of a circle "filling" up to a specific amount. The Issue It "works", but is not AS smooth as I think it could be, and I want to introduce some easing to it. But because I'm animating each % individually, I'm not sure that's possible right now. So I'm looking for alternatives that could solve this issue! Visual Explanation To start --

How to flip a UIView around the x-axis while simultaneously switching subviews

别来无恙 提交于 2019-11-30 09:21:18
This question has been asked before but in a slightly different way and I was unable to get any of the answers to work the way I wanted, so I am hoping somebody with great Core Animation skills can help me out. I have a set of cards on a table. As the user swipes up or down the set of cards move up and down the table. There are 4 cards visible on the screen at any given time, but only the second card is showing its face. As the user swipes the second card flips back onto its face and the next card (depending on the swipe direction) lands in it's place showing its face. I have set up my card

UIImageView is disappearing after CAKeyframeAnimation

泪湿孤枕 提交于 2019-11-30 07:38:55
I'm trying this code (found in an answer here on SO) in a category on UIView and am using it to peform a "pop" animation on a UIImageView nested inside of a UITableViewCell. - (void)attachPopUpAnimation { CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; CATransform3D scale1 = CATransform3DMakeScale(0.5, 0.5, 1); CATransform3D scale2 = CATransform3DMakeScale(1.2, 1.2, 1); CATransform3D scale3 = CATransform3DMakeScale(0.9, 0.9, 1); CATransform3D scale4 = CATransform3DMakeScale(1.0, 1.0, 1); NSArray *frameValues = [NSArray arrayWithObjects: [NSValue

How to split out multiple animations from Collada file in SceneKit

余生长醉 提交于 2019-11-30 05:31:07
问题 I am loading a third-party .dae Collada file as a scene into a SceneKit project. The .dae file has many different animations in it, set at different times/frames. I am trying to figure out how I can split these out and reference each individual animation by reference name. There are no intelligible reference names in the dae file - the animations are all set as one single animation. I am able to parse out the animations into a CAAnimation object, and verify that I have successfully done so

Making an animation to expand and shrink an UIView

可紊 提交于 2019-11-30 03:27:27
I want to create an animation that will resize an UIView and its contents by a factor. Basically, I want to make an animation that first expands the view then shrinks it back to the original size. What is the best way to do this? I tried CALayer.contentScale but it didn't do anything at all. You can nest some animation blocks together like so: Objective-C: [UIView animateWithDuration:1 animations:^{ yourView.transform = CGAffineTransformMakeScale(1.5, 1.5); } completion:^(BOOL finished) { [UIView animateWithDuration:1 animations:^{ yourView.transform = CGAffineTransformIdentity; }]; }]; Swift

Update view's frame while it's being animated

别来无恙 提交于 2019-11-29 15:40:37
I'm doing an animation like this: CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; animation.duration = 100.0; animation.path = self.animationPath.CGPath; [view.layer addAnimation:animation forKey:@"animation"]; Works fine, however, this now fails when trying to detect touches on the object that is moving around the screen: - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { for (UIView* subview in self.subviews ) { if ( [subview hitTest:[self convertPoint:point toView:subview] withEvent:event] != nil ) { [self handleTap]; return YES; } }

How to remove a layer when its animation completes?

久未见 提交于 2019-11-29 11:34:25
I am making an iOS App . I have several CALayer objects that eventually will be deleted by a (shrinking) animation . When the animation is completed, and animationDidStop:finished is invoked, I would like to remove the CALayer object from the super view and delete it. But how can I get the CALayer object in animationDidStop:finished ? I would have guessed that the CAanimation -object had a pointer to the layer, but I can't find it in the doc. Is there a better way to handle the issue? (Actually, I have several animation objects added to the same layer, and, ideally, I would like to remove the

Making an animation to expand and shrink an UIView

霸气de小男生 提交于 2019-11-29 00:06:04
问题 I want to create an animation that will resize an UIView and its contents by a factor. Basically, I want to make an animation that first expands the view then shrinks it back to the original size. What is the best way to do this? I tried CALayer.contentScale but it didn't do anything at all. 回答1: You can nest some animation blocks together like so: Objective-C: [UIView animateWithDuration:1 animations:^{ yourView.transform = CGAffineTransformMakeScale(1.5, 1.5); } completion:^(BOOL finished)