0
我想實現CABasicAnimation並在動畫完成時通知UIViewController。從這個資源:動畫委託不轉換爲Swift 3.0
http://www.informit.com/articles/article.aspx?p=1168314&seqNum=2
我明白,我可以指定視圖 - 控制作爲動畫的委託,並重寫的ViewController內animationDidStop
方法。然而,當我轉換的代碼以下行斯威夫特:
[animation setDelegate:self];
像這樣:
animation.delegate =自//沒有setDelegate方法
的XCode抱怨:
Cannot assign value of type 'SplashScreenViewController' to type 'CAAnimationDelegate?'
我做錯了什麼?我錯過了什麼嗎?