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…
![](../../users/profiles/3581582.webp)
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…
![](../../users/profiles/4379275.webp)
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…
![](../../users/profiles/7770035.webp)
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…
![](../../users/profiles/4572536.webp)
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…
![](../../users/profiles/3502608.webp)
Saoud Rizwan
- 569
- 8
- 19
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) {
…
![](../../users/profiles/11515703.webp)
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
…
![](../../users/profiles/11515703.webp)
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…
![](../../users/profiles/637988.webp)
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) {
…
![](../../users/profiles/4083744.webp)
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 =…
![](../../users/profiles/5683179.webp)
oneshot
- 271
- 3
- 18
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…
![](../../users/profiles/7698127.webp)
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…
![](../../users/profiles/5939932.webp)
Magi
- 11
- 3
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…
![](../../users/profiles/8279928.webp)
Gilles Dignard
- 45
- 7
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…
![](../../users/profiles/14351818.webp)
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:…
![](../../users/profiles/14351818.webp)
aheze
- 6,076
- 3
- 6
- 40