takuoka / TKSubmitTransition

Animated UIButton of Loading Animation and Transition Animation. Inspired by https://dribbble.com/shots/1945593-Login-Home-Screen
MIT License
2.28k stars 229 forks source link

the SpinerLayer isn't showing when call the method 'startLoadingAnimation()' #34

Open dongdong3344 opened 7 years ago

dongdong3344 commented 7 years ago

With Xcode Version 8.3.3 (8E3004b), I create a loginAndRegister Button, when I click the button, I want to call the 'startLoadingAnimation()' Method, but the sipnerLayer with default configuration won't show on the button. I didn't modify any file which in the TKSubmitTransition folder. Any analysis for it ?Thanks!

impresyjna commented 7 years ago

As far as I see, this line layer.add(shrinkAnim, forKey: shrinkAnim.keyPath) causes all the problems.

impresyjna commented 7 years ago

Also, there is a problem with spinner when constrains in storyboard are broken

tuononh commented 7 years ago

Same problem here on iOS 10, XCode 8, Swift 3.0. Any workaround?

jesster2k10 commented 7 years ago

Hey @wampir1408 can I have some more information and a few screenshots?

pavankataria commented 7 years ago

Not working here too, iOS 10, xcode 8, Swift 3.0

TomerAvni commented 5 years ago

The problem occurs because the SpinnerLayer is calculated before the TKTransitionSubmitButton has a size (even though it's lazy). I've. I've moved the spiner.spinnerColor = spinnerColor line to the startLoadingAnimation() function, so the spinner initialisation is delayed until TKTransitionSubmitButton has a concrete size.