Guest User

Untitled

a guest
Nov 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. func animateTextLabels() {
  2. let isExpandedMode = self.extensionContext?.widgetActiveDisplayMode == .expanded
  3. let scaleText:CGFloat = isExpandedMode ? 3 : 0.3
  4. UIView.animate(withDuration: 0.3, delay: 0, options: [.curveEaseOut], animations: {
  5. self.textLabel.transform = .init(scaleX: scaleText, y: scaleText)
  6. self.dateLabel.transform = isExpandedMode ? .init(translationX: 0, y: 20) : .identity
  7. }) { (finished) in
  8. UIView.animate(withDuration: 0.3, animations: {
  9. self.textLabel.transform = .identity
  10. })
  11. }
  12. }
Add Comment
Please, Sign In to add comment