मैं निम्न त्रुटि हो रही हैस्विफ्ट 3 में CABasicAnimation प्रतिनिधि सेट करने की समस्या?
इस CABasicAnimation ब्लॉक की अंतिम पंक्ति परप्रकार 'StarButton' टाइप करने के लिए का मूल्य निर्दिष्ट नहीं किया जा सकता 'CAAnimationDelegate?'
:
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
एक कस्टम UIButton वर्ग है। स्विफ्ट के पिछले संस्करणों में यह कोई मुद्दा नहीं था ... समाधान पर कोई सुझाव?
https://www.dropbox.com/s/gvc2sky05f4p3au/StarButton.swift?dl=0
क्या आप वाकई प्रतिनिधि प्रोटोकॉल के अनुरूप हैं? ऐप्पल डॉक्स से – Fogmeister
'UIButton' (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIButton_Class/)' CAAnimationDelegate' के अनुरूप नहीं है। क्या आपने स्पष्ट रूप से कहा था कि आपका सबक्लास एक प्रतिनिधि था? Http://stackoverflow.com/questions/24024466/how-do-i-make-a-class-conform-to-a-delegate-in-swift – Doc
@Fogmeister अच्छी तरह से यह एक ओपन सोर्स घटक का हिस्सा है जिसे मैंने पकड़ लिया और फ़ाइल की जांच करने के बाद इसमें कोई प्रोटोकॉल नहीं लगता है .. हालांकि यह तेजी से 2.xx –