caanimation

Mixing Images and Video using AVFoundation

ぐ巨炮叔叔 提交于 2019-12-21 04:51:13
问题 I'm trying to splice in images into a pre-existing video to create a new video file using AVFoundation on Mac. So far I've read the Apple documentation example, ASSETWriterInput for making Video from UIImages on Iphone Issues Mix video with static image in CALayer using AVVideoCompositionCoreAnimationTool AVFoundation Tutorial: Adding Overlays and Animations to Videos and a few other SO links Now these have proved to be pretty useful at times, but my problem is that I'm not creating a static

How to do a curve/arc animation with CAAnimation?

ぐ巨炮叔叔 提交于 2019-12-20 08:19:12
问题 I have an user interface where an item get deleted, I would like to mimic the "move to folder" effect in iOS mail. The effect where the little letter icon is "thrown" into the folder. Mine will get dumped in a bin instead. I tried implementing it using a CAAnimation on the layer. As far as I can read in the documentations I should be able to set a byValue and a toValue and CAAnimation should interpolate the values. I am looking to do a little curve, so the item goes through a point a bit

Need better and simpler understanding of CATransform3D

对着背影说爱祢 提交于 2019-12-20 08:18:46
问题 Please go through the images. So this is the code which I got from some online source and it does transform my object. Besides that, I understood nothing at all. I am new to CATransform3D and want to know exactly how it works. CATransform3D transform = CATransform3DIdentity; transform.m34 = 1.0 / -500; transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0f, 0, 1, 0.0f); _bgView.layer.transform = transform; I want to know how did this code run? Why did we set some value in m34? I

How can I callback as a CABasicAnimation is animating?

眉间皱痕 提交于 2019-12-20 06:04:45
问题 I have an animation I'm using to snap a rotatable UIView to a circular grid. As the view animates, I need to update another view based on the rotating views position. How can I go about getting the position of the rotating view as it animates into position? 回答1: When animation starts you can start a function that will be polling current view position using a timer (I suppose you will need to get presentationLayer from view's layer and get position values from it). There's no callbacks for

iOS: Should I Add UIViews or CALayers for animation?

删除回忆录丶 提交于 2019-12-19 17:34:48
问题 Let's say I want to add 50 images to a view for the purpose of animating them. And let's suppose I'm planning on using Core Animation (e.g., CABasicAnimation) rather than "UIView" animation. Am I better off implementing this by adding 50 subviews or 50 sublayers? Does it make a difference? Thanks. 回答1: As I describe here, I've used both UIViews and CALayers in animations and found a negligible performance difference between them. UIViews are very lightweight wrappers around the layers. Also,

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

﹥>﹥吖頭↗ 提交于 2019-12-18 13:54:15
问题 This question already has answers 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) Closed 2 years ago . 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

UIImageView is disappearing after CAKeyframeAnimation

守給你的承諾、 提交于 2019-12-18 12:38:34
问题 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 =

How to remove a layer when its animation completes?

▼魔方 西西 提交于 2019-12-18 06:57:04
问题 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?

How can I create an CABasicAnimation for multiple properties?

杀马特。学长 韩版系。学妹 提交于 2019-12-17 21:47:01
问题 I have this code to animate a CALayer element. CABasicAnimation *makeBiggerAnim=[CABasicAnimation animationWithKeyPath:@"radius"]; makeBiggerAnim.duration=0.2; makeBiggerAnim.fromValue=[NSNumber numberWithDouble:20.0]; makeBiggerAnim.toValue=[NSNumber numberWithDouble:40.0]; makeBiggerAnim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; My question is, now everything works fine, I would like another attribute of the same element at the same time.

How to properly animate sequentially using CAAnimation

情到浓时终转凉″ 提交于 2019-12-13 15:53:37
问题 I'm simply closing doors, delaying 2 sec/calling a method then opening them back. One comes from the left side and the other from the right side. I first used UIView animation block but then realized whenever user leaves the app during animation, its completion block would never get called. I could not find anyone complaining about such behavior when interruption happens during animation thus could not solve the problem and now I'm hoping CAAnimation's animationDidStop or CATransaction's