cabasicanimation

Resume CABasicAnimation backwards by setting .speed equal to -1

雨燕双飞 提交于 2021-02-05 11:38:53
问题 EDIT : i've refactored the question a bit and solved part of the issue, now the question comes down to why does the presentation layer glitches/flashes when the animation is resumed. At this point tho i'm accepting any answer that makes the animation resume both forwards and backwards at will with no issue. I'm not sure the approach i'm using is the right one, i'm still pretty new to Swift. Note : Sample project at the bottom, for having a better understanding of the issue. In my project i'm

Unexpected behaviour in animation when i change the properties of the model layers

烈酒焚心 提交于 2021-01-29 15:31:14
问题 Referring to this post, i'm trying to adapt the animations to landscape mode. Basically what i want is to rotate all layers of -90° (90° clockwise) and the animations to run horizontally instead of vertically. The author didn't bother to explain the logic under the hood, there are a dozen paper folding libraries in obj-c which are all based on the same architecture, so apparently this is the way to go for folding. EDIT : To further clarify what i want to achieve, here you can look at three

MBProgressHUD with CustomView: Why can't I animate my custom view?

﹥>﹥吖頭↗ 提交于 2021-01-29 09:50:58
问题 This somehow doesn't work...why? How can I achieve a spinning custom propeller without making a gif out of the animation? -(UIView *)propTest { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 37, 37)]; UIImageView *movablePropeller = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 37 , 37)]; movablePropeller.image = [UIImage imageNamed:@"MovablePropeller"]; [view addSubview:movablePropeller]; movablePropeller.center = view.center; CABasicAnimation *rotation; rotation =

How can I know the values in CABasicAnimation keyPath

删除回忆录丶 提交于 2020-12-28 13:13:49
问题 I find some code like this: CABasicAnimation *anim = [CABasicAnimation animation]; anim.keyPath = @"transform.scale"; anim.fromValue = [NSNumber numberWithFloat:1.0]; anim.toValue = [NSNumber numberWithFloat:0]; anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeBoth; anim.delegate = self; [self.view.layer addAnimation:anim forKey:@"scaleOut"]; and anim.keyPath = @"transform.rotation.x"; As far as I know, keyPath is a chained method invoke. "transform.scale" for CALayer is aLayer

How can I know the values in CABasicAnimation keyPath

我只是一个虾纸丫 提交于 2020-12-28 13:11:39
问题 I find some code like this: CABasicAnimation *anim = [CABasicAnimation animation]; anim.keyPath = @"transform.scale"; anim.fromValue = [NSNumber numberWithFloat:1.0]; anim.toValue = [NSNumber numberWithFloat:0]; anim.removedOnCompletion = NO; anim.fillMode = kCAFillModeBoth; anim.delegate = self; [self.view.layer addAnimation:anim forKey:@"scaleOut"]; and anim.keyPath = @"transform.rotation.x"; As far as I know, keyPath is a chained method invoke. "transform.scale" for CALayer is aLayer

CABasicAnimation disappear when home button is pushed

随声附和 提交于 2020-01-23 12:36:31
问题 I'm implementing a game, in which i have some CABasicAnimations. For example, like this : CABasicAnimation * borddroit = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; borddroit.fromValue = [NSNumber numberWithFloat:0.0f]; borddroit.toValue = [NSNumber numberWithFloat:749.0f]; borddroit.duration = t; borddroit.repeatCount = 1; [ImageSuivante2.layer addAnimation:borddroit forKey:@"borddroit"]; I put it in pause with this function : -(void)pauseLayer:(CALayer*)layer {

CABasicAnimation disappear when home button is pushed

大城市里の小女人 提交于 2020-01-23 12:36:04
问题 I'm implementing a game, in which i have some CABasicAnimations. For example, like this : CABasicAnimation * borddroit = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"]; borddroit.fromValue = [NSNumber numberWithFloat:0.0f]; borddroit.toValue = [NSNumber numberWithFloat:749.0f]; borddroit.duration = t; borddroit.repeatCount = 1; [ImageSuivante2.layer addAnimation:borddroit forKey:@"borddroit"]; I put it in pause with this function : -(void)pauseLayer:(CALayer*)layer {

How do you animate the sublayers of the layer of a UIView during a UIView animation?

不打扰是莪最后的温柔 提交于 2020-01-09 18:23:25
问题 In a UIView animation for a view, you can animate its subviews being laid out by including UIViewAnimationOptionLayoutSubviews in the options parameter of [UIView animateWithDuration:delay:options:animations:completion:] . However, I cannot find a way to animate it laying out its sublayers when they are not some view's backing layer; they would just jump into place to match the new bounds of the view. Since I'm working with layers and not views, it seems like I have to use Core Animation

CABasicAnimation not working on device (iPhone 5s)

两盒软妹~` 提交于 2020-01-06 17:57:37
问题 I have a CABasicAnimation that creates an iris wipe effect on an image. In short, the animation works fine on the simulator but there is no joy on device. The timers still fire correctly and the animationCompleted block gets called however there is no visible animation. Here is the code to get the iris wipe working: - (void)irisWipe { animationCompletionBlock theBlock; _resultsImage.hidden = FALSE;//Show the image view [_resultsImage setImage:[UIImage imageNamed:@"logoNoBoarder"]]; [