I'm getting the following error
Cannot assign value of type 'StarButton' to type 'CAAnimationDelegate?'
on the last line of this CABasicAnimation block:
let fillCircle = CABasicAnimation(keyPath: "opacity")
fillCircle.toValue = 0
fillCircle.duration = 0.3
fillCircle.setValue(notFavoriteKey, forKey: starKey)
fillCircle.delegate = self // this is where the error is thrown
self
is a custom UIButton class. This wasn't an issue in previous versions of Swift... any suggestions on a solution?
UPDATE
Here is a downloadable link to the source file for the StarButton class for best reference:
https://www.dropbox.com/s/gvc2sky05f4p3au/StarButton.swift?dl=0