Questions tagged [uiviewpropertyanimator]

86 questions
26
votes
2 answers

Is there a way to observe changes to fractionComplete in UIViewPropertyAnimator

I've been looking at the very cool new UIViewPropertyAnimator class in iOS 10. It lets you easily do things like pause, resume, and reverse in-flight UIView animations. It used to be that you had to manipulate the underlying CAAnimations the system…
Duncan C
  • 115,063
  • 19
  • 151
  • 241
17
votes
1 answer

When to use UIView animation, CABasicAnimation and UIViewPropertyAnimator?

I wanted to know in which scenarios we should use any of them as the best fit? In the following blog https://www.hackingwithswift.com/ios10, the example written in "Animations revisited" section, can we re-apply the same requirement using…
Raj
  • 911
  • 1
  • 12
  • 26
15
votes
3 answers

Extend UIViewPropertyAnimator?

UIViewPropertyAnimator is very convenient for modifying a view's transform, alpha, etc. However, there are times when you wish to animate a CAShapeLayer path, or a UIImageView image changing. Is there any way to extend the functionality of…
GoldenJoe
  • 7,100
  • 3
  • 45
  • 79
13
votes
1 answer

UIViewPropertyAnimator - simply stop all animations, rather than a specific one?

In UIViewPropertyAnimator, is there a way to just stop all UIViewPropertyAnimator animations? Or perhaps simply get all current animations - then of course you could stop them all. Can this be done? Or do you really have to (a) do only one per…
Fattie
  • 30,632
  • 54
  • 336
  • 607
12
votes
1 answer

UIPercentDrivenInteractiveTransition Cancelling Issue

What I Have I am using UIViewControllerAnimatedTransitioning protocol with an attached UIViewPropertyAnimator to pan down to dismiss a View Controller extension SecondViewController : UIViewControllerAnimatedTransitioning { func…
Gizmodo
  • 2,563
  • 4
  • 32
  • 71
11
votes
1 answer

Why does UIView.animate work with an interactive controller transition, but UIViewPropertyAnimator doesn't?

For boilerplate on setting up a gesture recognizer and such for the interactive transition, see this answer. I am experimenting with interactive transitions, and spent quite a bit of time trying to figure out why the controllers would transition…
GoldenJoe
  • 7,100
  • 3
  • 45
  • 79
10
votes
3 answers

UIViewPropertyAnimator different behaviour on iOS10 and iOS11 reversing an animation. Bug on `isReversed` and `fractionComplete` properties?

THE PROBLEM Running the same code on iOS10 and iOS11 my UIViewPropertyAnimator has a different behaviour just after changing of his .isReversed property. Everything is ok on iOS10. The animation problem happens on iOS11 CONDITIONS It's true for any…
Giovanni Trezzi
  • 335
  • 4
  • 17
8
votes
3 answers

Animate the fractionComplete of UIViewPropertyAnimator for blurring the background

So I'm using the new UIViewPropertyAnimator and UIVisualEffectView to achieve the same thing as the Spotlight search when you scrolling down on the home screen and it blurs the background. I'm using the fractionComplete property to set the procent…
alengqvist
  • 441
  • 5
  • 15
6
votes
1 answer

Combine many UIViewPropertyAnimators

I was messing with the documentation of UIViewPropertyAnimator and I was hoping to find a way to combine two UIViewPropertyAnimator. Something like this: let firstAnimator = UIViewPropertyAnimator( duration: 2, dampingRatio: 0.4, …
Tiago Almeida
  • 13,437
  • 3
  • 62
  • 80
6
votes
1 answer

How do duration and UISpringTimingParameters interact in UIViewPropertyAnimator?

iOS 10 has a couple of new classes for animating. Notable ones include UIViewPropertyAnimator and UISpringTimingParameters. The property animator can be created with a duration and timing parameters - the timing parameters can be an instance of the…
Tom Hamming
  • 9,484
  • 9
  • 66
  • 131
5
votes
2 answers

UIViewPropertyAnimator's bounce effect

Let's say I have an animator that moves a view from (0, 0) to (-120, 0): let frameAnimator = UIViewPropertyAnimator(duration: duration, dampingRatio: 0.8) animator.addAnimations { switch state: case .normal: view.frame.origin.x = 0 …
5
votes
1 answer

How is the initial velocity of UISpringTimingParameters specified?

I'm trying to perform a spring animation on a view which is released by the user's pan gesture and may have a non-zero velocity. I'm basically trying to recreate the animation of this WWDC video where they use…
Tim Vermeulen
  • 11,713
  • 9
  • 41
  • 63
5
votes
0 answers

Reversing UIViewPropertyAnimator causes frame animation issue

I am using a UIViewPropertyAnimator to animate the frame of a UICollectionViewCell. I look at the velocity of a pan gesture recognizer to decide whether the animator should finish naturally or reverse and go back to the initial state. In all…
Daniel Larsson
  • 5,762
  • 5
  • 39
  • 75
4
votes
0 answers

How do I create a custom view controller transition that is interruptable/cancellable?

I have a small custom view controller (it's a menu) I'm presenting, and I want you to be able to halt the presentation half way through if you change your mind. Per this WWDC 2016 video, doing so should be pretty easy and just require the…
christianselig
  • 306
  • 4
  • 14
4
votes
1 answer

iOS 13 breaks UIViewPropertyAnimator transition

We have a broken transition in WeatherKit only reproducible on iOS 13 beta. We're unsure if this is an UIKit bug or we're doing something awfully wrong. With an array of UIViewPropertyAnimator working before iOS 13, ever since iOS 13 (through all…
perte
  • 261
  • 2
  • 3
  • 16
1
2 3 4 5 6