Open chatarveer opened 6 years ago
1- Jump to definition of 'startFinishAnimation' method which written in 'TransitionSubmitButton.swift'
2- Change this method to:
open func startFinishAnimation(_ delay: TimeInterval , animate: Bool, completion:(()->())?) {
if !animate {
self.spiner.stopAnimation()
self.returnToOriginalState()
return
}
Timer.schedule(delay: delay) { timer in
self.didEndFinishAnimation = completion
self.expand()
self.spiner.stopAnimation()
}
}
3- In 'TransitionSubmitButton.swift', find startFinishAnimation(duration, completion: completion) and replace it to: startFinishAnimation(duration , animate: true, completion: completion)
4- Done! now if user entered incorrect info, use this:
loginBtn.startFinishAnimation(0.0 , animate: false, completion:{
// alert user...
})
Just tried this and now it seems it never stops spinning.
Call returnToOriginalState() instead of startFinishAnimation.
Its creating color on navigation and If I show UIAlertController, it messed all.
How to stop with without animation--- make it back to simple button if response is error. Its spreading red color/ color of button over Navigation background....