Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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