I'm new to Swift code and sorry for my bad english. Here is my code:
var t = Array<MyClassProtocol> ()
var instance1 = MyClasse () //protocol MyClassProtocol
var instance2 = MyClasse () //protocol MyClassProtocol
var instance3 = MyClasse2 () //protocol MyClassProtocol
t.append (instance1)
t.append (instance2)
t.append (instance3)
//What I try to do
for instance in t
{
if (instance === instance1){ /* do something */ }
}
XCode return : type MyClassProtocol does not conform to protocol "AnyObject"
Any Idea ? Thanks