Questions tagged [uiviewpropertyanimator]

86 questions
1
vote
0 answers

UIView frame animation not updating subviews layout - UIViewPropertyAnimator

I am trying to to a simple frame animation with UIViewPropertyAnimator. If I animate the frame, it works great. The problem arrives when you add subviews with autolayout constraints. Subviews frames are calculated at the beginning of the animation…
Cristian Pena
  • 1,989
  • 16
  • 30
1
vote
0 answers

UIViewPropertyAnimator finish corresponding API

Using the UIViewPropertyAnimator I can simply stop it and call finishAnimation(at: .end) to earlier finish ongoing animation. What API on iOS 9 would I have to use in order to achieve same behaviour using the traditional UIView block-based…
Damian
  • 135
  • 2
  • 7
1
vote
2 answers

Swift UIViewPropertyAnimator automatically plays when leaving app

Good day everyone! I've a problem with my app. I'm using an UIViewPropertyAnimator to animate my blur. I let the blur effect run from nil (0) to .light (1) but because the light effect is just too much I set the UIViewPropertyAnimator to 0.1…
MaximVW
  • 123
  • 2
  • 12
1
vote
0 answers

UIViewPropertyAnimator does not update the view when expected

Here is a Swift playground code, which I also tested in the iOS Simulator just to be sure that it's not an issue of Playground. Setting the property fractionComplete result in change of state from inactive to active. However as shown below the view…
DevAndArtist
  • 4,391
  • 1
  • 20
  • 45
1
vote
1 answer

Can UISpringTimingParameters have an inverse spring effect?

After dabbling with UIViewPropertyAnimator, I've found that .isReversed simply plays the animation backwards like a movie in reverse. Is it possible to apply "springiness" to the reverse animation through a custom Cubic Timing Parameter that only…
0
votes
1 answer

Dismissing View Controller after UIViewPropertyAnimator animation is completed

I'm trying to dismiss a view controller after completing the animation. But currently the view controller dismisses before animation starts. var animator : UIViewPropertyAnimator? @IBAction func CloseEverything(_ sender: UIButton) { …
unknown
  • 111
  • 7
0
votes
0 answers

Reversing UIViewPropertyAnimator with toggle button Swift

With the code below I can't seem get the reverse animation to run. // UIViewPropertyAnimator let customBlur = BlurView.init(effect: UIBlurEffect.init(style:UIBlurEffect.Style.systemThickMaterialDark), intensity: 0) var onState = false …
unknown
  • 111
  • 7
0
votes
1 answer

UIViewPropertyAnimator with short animation segments in the beginning

Imagine UIViewPropertyAnimator is setup as follows: let animator = UIViewPropertyAnimator(duration: 2, curve: .easeInOut) { myView.center = newCenterPoint } For this, I can add another animation that starts with a delay, ends with the…
Gizmodo
  • 2,563
  • 4
  • 32
  • 71
0
votes
1 answer

Issue playing UIViewPropertyAnimator again

I am having an issue with UIViewPropertyAnimator, setup as follows: let animator = UIViewPropertyAnimator(duration: 6.0, curve: .linear) animator.addAnimations { UIView.animateKeyframes(withDuration: 6.0, delay: 0.0) { …
Kex
  • 6,762
  • 5
  • 39
  • 93
0
votes
0 answers

How to animate a blur effect up until a certain intensity?

I'm trying to animate a blur effect up until a certain intensity. Doing so using the .animate method of UIView is trivial: let visualEffectView = UIVisualEffectView(effect: nil) UIView.animate(withDuration: 1) { visualEffectView.effect =…
0
votes
0 answers

Implementing auto-scroll in ScrollView, using UIViewPropertyAnimator: glitch when trying to scroll manually

I am using a UIViewPropertyAnimator to automatically start scrolling a scrollView. I would like the animation to simply stop when the user starts dragging the scrollView manually. Users can basically take back control of scrolling at any…
Kqtr
  • 5,397
  • 3
  • 17
  • 27
0
votes
0 answers

How to implement the three mode transition using UIViewPropertyAnimator?

I was trying to implement the three mode transitions using UIViewPropertyAnimator,i able to achieve the two mode transitions successfully, but fails to perform the middle mode downward animation.Below GIF is what achieved so far. func…
0
votes
0 answers

UIScrollView is using an unrelated UIViewPropertyAnimator when it shouldn't

I'm using a UIScrollView whose content is a simple UIView subclass whose size is set using auto layout and which uses drawRect: to render its content rather than having subviews of its own. If the content (and the size) of the UIView changes then…
0
votes
1 answer

Synchronously animate CALayer property and UIView with UIViewPropertyAnimator

I'm using a UIViewPropertyAnimator to animate the position of a view. But, I also want to animate CALayer properties like borderColor along with it. Currently, it doesn't animate and instantly changes at the start, like this: Here's my code: class…
aheze
  • 6,076
  • 3
  • 6
  • 40
0
votes
0 answers

Set values greater than 1 or less than 0 for UIViewPropertyAnimator's fractionComplete

I'm setting propertyAnimator?.fractionComplete to change the position of a view, based on my pan gesture's translation. Later, I'm planning to animate it back to CGPoint.zero once the finger lifts. Here's my code: class ViewController:…
aheze
  • 6,076
  • 3
  • 6
  • 40