Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @objc func buttonUp(_ sender: UIButton) {
- toCam.transform = CGAffineTransform.identity.scaledBy(x: 1, y: 1)
- toCam.backgroundColor = .yellow
- segue()
- }
- func segue() {
- performSegue(withIdentifier: "GoToCam", sender: self)
- }
- class goToCamAnimCustom: UIStoryboardSegue {
- override func perform() {
- scale()
- }
- func scale() {
- guard let destinationView = self.destination.view else {
- // Fallback to no fading
- self.source.present(self.destination, animated: false, completion: nil)
- return
- }
- destinationView.alpha = 0
- self.source.view?.addSubview(destinationView)
- UIView.animate(withDuration: CATransaction.animationDuration(), animations: {
- destinationView.alpha = 0.5
- }, completion: { _ in
- self.source.present(self.destination, animated: false, completion: nil)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement