قالب وردپرس درنا توس
Home / IOS Development / Ios – After the custom segy finish is the camera turned off?

Ios – After the custom segy finish is the camera turned off?



I'm trying to use a custom transition to a full-screen custom camera. When I do that with a slow fade animation, it gets black after the animation is complete.

The camera that at the beginning of the animation seems to work,

code:

mainVC:

      @objc func buttonUp (_ sender: UIButton) {19 send:

toCam.transform = CGAffineTransform.identity.scaledBy (x: 1, y: 1)
toCam.backgroundColor = .yellow

natural transition ()
}

func segue () {
performSegue (withIdentifier: "GoToCam", sender: self)
}

Custom seal class:

  class goToCamAnimCustom: UIStoryboardSegue {

override func perform () {) {
scale ()

}

func scale () {

guard let destinationView = self.destination.view other {
// Fallback to no fading
self.source.present (self.destination, animated: false, completing: null)
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, completing: null)
})

}

}


Source link