Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. @objc func buttonUp(_ sender: UIButton) {
  2.  
  3. toCam.transform = CGAffineTransform.identity.scaledBy(x: 1, y: 1)
  4. toCam.backgroundColor = .yellow
  5.  
  6. segue()
  7. }
  8.  
  9. func segue() {
  10. performSegue(withIdentifier: "GoToCam", sender: self)
  11. }
  12.  
  13. class goToCamAnimCustom: UIStoryboardSegue {
  14.  
  15. override func perform() {
  16. scale()
  17.  
  18. }
  19.  
  20. func scale() {
  21.  
  22. guard let destinationView = self.destination.view else {
  23. // Fallback to no fading
  24. self.source.present(self.destination, animated: false, completion: nil)
  25. return
  26. }
  27.  
  28. destinationView.alpha = 0
  29. self.source.view?.addSubview(destinationView)
  30.  
  31. UIView.animate(withDuration: CATransaction.animationDuration(), animations: {
  32. destinationView.alpha = 0.5
  33. }, completion: { _ in
  34. self.source.present(self.destination, animated: false, completion: nil)
  35. })
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement