We usually use the class keyword to define a class only protocol in the normal way.

1
2
3
protocol DetailViewControllerDelegate: class {
func didFinishTask(sender: DetailViewController)
}

Since Swift 4, we have an other way to define it. Introduced in 0156-subclass-existentials

This proposal merges the concepts of class and AnyObject, which now have the same meaning: they represent an existential for classes.

So, it much clearer with the new way:

1
2
3
protocol DetailViewControllerDelegate: AnyObject {
func didFinishTask(sender: DetailViewController)
}

Happy coding!