Advertisement
Guest User

Untitled

a guest
May 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // C
  2. UIView.animate(withDuration: 0.3, animations: {
  3. self.plusPoints.alpha = 1
  4. self.plusPoints.text = "+10"
  5. self.plusPoints.textColor = .green
  6. self.plusPoints.transform = CGAffineTransform(scaleX: 2, y: 2)
  7. }) { (_) in
  8. UIView.animate(withDuration: 0.3, animations: {
  9. self.plusPoints.transform = CGAffineTransform.identity
  10. self.plusPoints.alpha = 0
  11. })
  12. }
  13.  
  14. // D
  15. UIView.animate(withDuration: 0.3, animations: {
  16. self.plusPoints.alpha = 1
  17. self.plusPoints.text = "-5"
  18. self.plusPoints.textColor = .red
  19. self.plusPoints.transform = CGAffineTransform(scaleX: 2, y: 2)
  20. }) { (_) in
  21. UIView.animate(withDuration: 0.3, animations: {
  22. self.plusPoints.transform = CGAffineTransform.identity
  23. self.plusPoints.alpha = 0
  24. })
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement