Weak' must not be applied to non-class-bound consider adding a protocol conformance that has a class bound

raheem picture raheem · Jun 28, 2018 · Viewed 21.9k times · Source

I'm a bit confused. What's the difference between protocol A : class { ... } and protocol A{ ... }, and which one we should use in swift?

PS: we got an error when we wrote like this

protocol A{ ... }

weak var delegate: A

error : 'weak' cannot be applied to non-class type

Answer