You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This had me scratching my head for a bit.
The following code never triggers the onComplete handler:
let v = UIView()
view.addSubview(v)
Kinetic.to(v, duration: 0.1, options: [.BackgroundColor(UIColor.whiteColor())]).play().onComplete { anim in
print("complete")
}
reason: backgroundColor property of the UIView is nil. Maybe add some check for that?
The text was updated successfully, but these errors were encountered:
That wouldn't animate since you're trying to animate a property whose initial value is nil, so the tween property isn't being created and added to the tween since there's no initial condition/value to tween from. Technically this is the correct functionality but it should ideally be throwing an exception when creating the tween so it's not failing silently and the user knows there's no initial value.
At first I considered just using UIColor.clearColor() when the property's value is nil, but not sure if this is the best assumption even if it's the easiest to use. An alternative would be to use Kinetic.fromTo where you'd set the from color value to UIColor.clearColor().
I'll add in some assertions when setting up the tween properties to help in these cases.
Yeah, I know it's not an ideal case. I was just wondering for the longest time why the complete handler only (seemingly) randomly executes (because in some cases there was actually a background color set before somewhere else in the code).
Just want to avoid that others run into the same issue and waste time.
This had me scratching my head for a bit.
The following code never triggers the onComplete handler:
reason:
backgroundColor
property of theUIView
isnil
. Maybe add some check for that?The text was updated successfully, but these errors were encountered: