3

In the section of code below, what exactly does the <UIScrollViewDelegate> part mean and do? what would it most likely be used for and what would most likely happen if it was removed? (any theoretical example is good)

@interface PhoneContentController : ContentController <UIScrollViewDelegate>
justin
  • 104,054
  • 14
  • 179
  • 226
Dollarslice
  • 9,917
  • 22
  • 59
  • 87

1 Answers1

2

It means that PhoneContentController adopts the ObjC protocol named UIScrollViewDelegate.

A protocol is an interface of methods without definition. When the class adopts it, it advertises that it implements the methods declared by the protocol.

This is a common feature in OOD for an abstract type, particularly in languages which use single inheritance only. If you know Java, it's much like implements UIScrollViewDelegate.

justin
  • 104,054
  • 14
  • 179
  • 226