type A requires that type B be a class type swift 4
You can’t have a WeakReference<ServiceDelegate>. ServiceDelegate itself is not an AnyObject, it just requires that anything that conforms to it be an AnyObject. You would need to make SomeClass generic and use the generic type as the type for the WeakReference: class SomeClass<T: ServiceDelegate> { private var observers = [WeakReference<T>]() } If the generic on … Read more