What’s the difference between a protocol extended from AnyObject and a class-only protocol?

This was answered by an official Swift developer (Slava_Pestov) on the Swift forums. Here is the summary:

  • You should use AnyObject (protocol SomeProtocol: AnyObject).

  • AnyObject and class are equivalent. There is no difference.

  • class will eventually be deprecated.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)