Im trying to assign a delegate of a node inside another class, but its not working.
Example:
Class A:
import SpriteKit
protocol ClassADelegate {
func testA() -> Bool
}
class ClassA: SKSpriteNode {
}
Class B:
import SpriteKit
protocol ClassBDelegate {
func testB() -> Bool
}
class ClassB: SKSpriteNode {
let aux = ClassA()
aux.delegate = self
}
So my problem is when i try to initialize the aux delegate. I already tried aux.delegate = ClassADelegate but that dont work either. It says i cant Assign a value of type ClassADelegate.protocol to ClassADelegate.
Any solution? Thanks.
Ps.: This is a very simple example and i know it dont result in anything. My problem is just with the delegate declaration.