【发布时间】:2020-07-20 16:02:09
【问题描述】:
这是什么意思?
条件绑定的初始化器必须是 Optional 类型,而不是 'AnimationView'
一直在努力弄清楚我的意思以及如何解决它? 任何帮助将不胜感激
override func viewDidLoad() {
super.viewDidLoad()
if let animationView = AnimationView(name: "breathing") {
animationView.frame = CGRect(x: 0, y: 0, width: 400, height: 400)
animationView.center = self.view.center
animationView.contentMode = .scaleAspectFill
view.addSubview(animationView)
animationView.play()
}
【问题讨论】:
-
More than 150 similar Q&As 他们都没有帮助?