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
{{ message }}
This repository has been archived by the owner on Jan 5, 2020. It is now read-only.
Basically I have a sidemenu that I am using DKChainableAnimationKit to both show and hide my sidebar, which works perfect. However, I have noticed that when I've been using timers, the animation seem to crash. For instance, I have a timer that counts down from 10 to 0, basically by decreasing the global integer by 1, every second. When I make the countdown start, and click the button to show the sidebar - it suddenly disappears. To avoid this, I have been trying to do a .makeOrigin after the animation has been done - with no luck. I have also tried to do the countdown in the timer update function running async, also with no luck.
Any ideas on how I would approach this?
Here is my code:
Button for showing sidebar: self.sideview.animation.moveX(350).easeInOutSine.animate(0.5)
func counter() {
self.count = Int(self.count - 1) //When I add this line, the animation disappears (or the sidebar)
self.newGameLabel.text = String(self.count) //This line works, without any error.
}
}
Could someone please help me to fix this? Much appreciated.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Basically I have a sidemenu that I am using DKChainableAnimationKit to both show and hide my sidebar, which works perfect. However, I have noticed that when I've been using timers, the animation seem to crash. For instance, I have a timer that counts down from 10 to 0, basically by decreasing the global integer by 1, every second. When I make the countdown start, and click the button to show the sidebar - it suddenly disappears. To avoid this, I have been trying to do a .makeOrigin after the animation has been done - with no luck. I have also tried to do the countdown in the timer update function running async, also with no luck.
Any ideas on how I would approach this?
Here is my code:
Button for showing sidebar:
self.sideview.animation.moveX(350).easeInOutSine.animate(0.5)
Timer:
self.countdownText = Foundation.Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(ViewController.counter), userInfo: nil, repeats: true)
Counter Function:
Could someone please help me to fix this? Much appreciated.
The text was updated successfully, but these errors were encountered: