【发布时间】:2017-02-05 19:14:13
【问题描述】:
我想实现 CABasicAnimation 并在动画完成时通知 UIViewController。来自此资源:
http://www.informit.com/articles/article.aspx?p=1168314&seqNum=2
我知道我可以将 viewcontroller 指定为动画的委托,并在 viewcontroller 中覆盖 animationDidStopmethod。但是,当我将以下代码行转换为 Swift 时:
[animation setDelegate:self];
像这样:
animation.delegate = self //没有setDelegate方法
XCode 抱怨:
Cannot assign value of type 'SplashScreenViewController' to type 'CAAnimationDelegate?'
我做错了什么?我错过了什么吗?
【问题讨论】:
标签: ios swift delegates core-animation caanimation