-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Unsupport this animation type!" exception #25
Comments
Can you provide this animation intact code in your project? |
No, I can provide intact code as this is hard to achieve.
The problem arises on step 3 with animation from Stellar on Before using explicit animations on |
What is the unsupport animation's 'type'? |
@AugustRush myView.makeAlpha(0.0)
.duration(aDuration)
.autoreverses()
.repeatCount(someRepetitions)
.completion {
// Some statements
myView.removeFromSuperview()
}
.animate() So the FYI breakpoint does not stop on fatalError invocation' line. Any idea? |
Because all UIView's animation just it's layer's animation, you should not use alpha on CALayer,replace it with 'opacity'. |
But I use alpha because It's like if somewhere in Stellar when using alpha for |
I found a trick to make it work by modifying Stellar. The goal is to treat case .opacity(let o):
let from = self.opacity
let to = o
let render = {(f: Float) in
self.opacity = f
}
switch style {
case .basic:
behavior = basicBehavior(step, from: from, to: to, render: render)
case .attachment(let damping, let frequency):
behavior = attachmentBehavior(damping, frequency: frequency, from: from, to: to, render: render)
case .gravity(let magnitude):
behavior = gravityBehavior(magnitude, from: from, to: to, render: render)
case .snap(let damping):
behavior = snapBehavior(damping, from: from, to: to, render: render)
}
// [1]
case .alpha(let a):
let from = self.opacity
let to = Float(a) // [2]
let render = {(f: Float) in
self.opacity = f
}
switch style {
case .basic:
behavior = basicBehavior(step, from: from, to: to, render: render)
case .attachment(let damping, let frequency):
behavior = attachmentBehavior(damping, frequency: frequency, from: from, to: to, render: render)
case .gravity(let magnitude):
behavior = gravityBehavior(magnitude, from: from, to: to, render: render)
case .snap(let damping):
behavior = snapBehavior(damping, from: from, to: to, render: render)
} So there must be a problem somewhere on Stellar! |
Yes, must be somewhere has a problem. |
Here are more details about this problem. I noticed another weird behavior on animations on my app. After animations ended, animated UIViews are back to their initial states – the state before the animation occurred. For example, an UIView move from point A to point B then back to point A after the animation complete. This is a common behavior when using keyframe animations: differences between layer tree and presentation tree . But in this case this occur after animations on UIViews made using Stellar. If I replace the Stellar animations by a class UIView animation block then everything work as expected. Hope this lead you to the code of the problem! |
With
0.66
this exception is thrown on very basic animation:Let's say it's a find of flash.
I tried other animation like
makeSize
ormakeColor
but same behavior.This flash portion of code is called several times on a sequence basis. On the first call everything is fine. The exception is raises on the second call.
Between these two calls of flash there is an animation using
CATransaction
. On the completion block of this animation the second call of flash is then made.This error came after I decided to use
CATransaction
to use it's completion block.The text was updated successfully, but these errors were encountered: