Skip to content
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

TKSubmitTransitionButton. How do i stop a button from transition/ animating when user login/ signup are incorrect #49

Open
chatarveer opened this issue Jun 16, 2018 · 3 comments

Comments

@chatarveer
Copy link

chatarveer commented Jun 16, 2018

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....

@iMattin
Copy link

iMattin commented Aug 9, 2018

You should change some lines of 'TransitionSubmitButton.swift'. to do this, follow these short steps:

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...
})

@treyholt
Copy link

Just tried this and now it seems it never stops spinning.

@salil09
Copy link

salil09 commented Oct 14, 2018

Call returnToOriginalState() instead of startFinishAnimation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants