Created
December 31, 2018 15:25
-
-
Save ktanaka117/e4fd8f04b89c336632f91213f394cbc6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let textColorAnimation = CABasicAnimation(keyPath: "foregroundColor") | |
textColorAnimation.duration = 2.0 / 3 // duration = 30fpsのうちの約20frame | |
textColorAnimation.fromValue = Color.primaryBrand.cgColor | |
textColorAnimation.toValue = Color.black.cgColor | |
textColorAnimation.fillMode = .forwards | |
UIView.animate(withDuration: 2.0 / 3, animations: { [weak self] in | |
guard let strongSelf = self else { return } | |
strongSelf.animationText.add(textColorAnimation, forKey: "TextColor") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment