Using as a concrete type conforming to protocol AnyObject is not supported
问题 I'm using Swift 2 and using WeakContainer as a way to store a set of weak objects, much like NSHashTable.weakObjectsHashTable() struct WeakContainer<T: AnyObject> { weak var value: T? } public protocol MyDelegate : AnyObject { } Then in my ViewController, I declare public var delegates = [WeakContainer<MyDelegate>] But it is error Using MyDelegate as a concrete type conforming to protocol AnyObject is not supported I see that the error is that WeakContainer has value member declared as weak ,