Created
November 22, 2017 10:58
-
-
Save stfalconaleks/4b3ca7b368e88e1cf3822206032facec 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
func animateTextLabels() { | |
let isExpandedMode = self.extensionContext?.widgetActiveDisplayMode == .expanded | |
let scaleText:CGFloat = isExpandedMode ? 3 : 0.3 | |
UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseOut], animations: { | |
self.textLabel.transform = .init(scaleX: scaleText, y: scaleText) | |
self.dateLabel.transform = isExpandedMode ? .init(translationX: 0, y: 20) : .identity | |
}) { (finished) in | |
UIView.animate(withDuration: 0.3, animations: { | |
self.textLabel.transform = .identity | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment