1

I am sorry if this question has been asked so many times. I have been searching up and reading what delegate is and I still can't figure out what the differences are between delegate and protocol.

Let's say there is a class A and a class B.

My understanding is that a delegate contains a set of methods that class A can adopt and implement then an instance of A can use those methods on an instance of B when some other events happen(e.g. viewDidLoad()).

But aren't those methods just like optional method signatures in protocols?

I cant seem to see the difference between delegate and protocols. Can someone explain this to me as I am still fairly new to iOS development and MVC concepts in general.

GalaxyVintage
  • 656
  • 1
  • 11
  • 20

1 Answers1

2

Delegate (delegation) is a design pattern and protocol is a way to achieve it

Usama
  • 1,945
  • 1
  • 13
  • 20