Q:

Is it necessary to set scrollview.delegate as self?

I am taking an online iOS course provided by Stanford. In the sample code, 
@IBOutlet weak var scrollView: UIScrollView! {
    didSet {
        scrollView.contentSize = imageView.frame.size
        // all three of the next lines of code
        // are necessary to make zooming work
        scrollView.delegate = self
        scrollView.minimumZoomScale = 0.03
        scrollView.maximumZoomScale = 1.0
    }
}

However, if I remove scrollView.delegate = self, this scroll view still works on the simulator.
My questions:

Is it necessary to set scrollview.delegate as self? Why or why not?
What does self refer to? command + left click locate "did set". 

A:

You do not have to set the delegate for scrollView. You only do it if you want to react delegate methods that scrollView calls. For example, if you want to do something when user performs a scroll, you need to set the delegate and implement func scrollViewDidScroll(scrollView: UIScrollView) method. Everytime user scrolls, you will be able to react in this method's body.
Self refers to the class that holds this variable. In this case it will be probably your UIViewController

A:

Define, it still works? I mean if you can move it with touch, yeah it will work.
The reason for 
scrollView.delegate = self

is that it allows you to add code which can execute upon scroll began, scroll  ended etc. That way you have customization points to alter the behavior or actions of scrollview. Without that little code the delegate code will never get called. 
Makes sense?

