Ich versuche einen Animationsübergang zu verwenden, wenn ein UIView auf dem Bildschirm angezeigt wird. Die UIView wird korrekt angezeigt, die Animation wird jedoch nicht angezeigt, wenn sie angezeigt wird.UIView Transitionsanimation wird nicht ausgeführt
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let coreView = UIView(frame: CGRect(x: 10, y: 10, width: 100, height: 100))
coreView.backgroundColor = UIColor.cyan
coreView.layer.borderColor = UIColor.darkGray.cgColor
coreView.layer.borderWidth = 8
coreView.layer.cornerRadius = 15
coreView.isHidden = true
self.view.addSubview(coreView)
//The transition occurs here
UIView.transition(with: coreView, duration: 2, options: [.curveEaseInOut, .transitionCurlDown], animations: {
coreView.isHidden = false
}, completion: {_ in})
}
Das war es! Es funktioniert jetzt :) – SwiftyJD