Pattern: Invalid class delegate protocol
Issue: -
Delegate protocols should be class-only so they can be weakly referenced.
Examples of correct code:
protocol FooDelegate: class {}
protocol FooDelegate: class, BarDelegate {}
protocol Foo {}
class FooDelegate {}
@objc protocol FooDelegate {}
@objc(MyFooDelegate)
protocol FooDelegate {}
protocol FooDelegate: BarDelegate {}
protocol FooDelegate: AnyObject {}
protocol FooDelegate: NSObjectProtocol {}
Examples of incorrect code:
↓protocol FooDelegate {}
↓protocol FooDelegate: Bar {}