title: How come the idea of "event listeners" in swift are divided between actions and protocols?
body: <h2>My problem</h2>
  
  <p>as a new programmer currently learning swift. I was wondering why there seems to be an arbitrary divide between how event listeners are implemented.</p>
  
  <p>In some tutorials, it is pointed out that you can simply drag between view elements on story boards and view controllers to create actions (event listeners).</p>
  
  <pre><code>@IBAction func clickButtonListener(_ sender: UIButton) {
      print("hello world")
  }
  </code></pre>
  
  <p>But in later tutorials, I noticed that certain event listener-like functionality is also implemented in the form of protocols</p>
  
  <pre><code>class ViewController: UIViewController, UIScrollViewDelegate {
       func scrollViewDidScroll(...) {
           ...
       }
  }
  </code></pre>
  
  <h2>My questions</h2>
  
  <ol>
  <li>Why are there seemingly 2 methodologies of implementing event listeners?   </li>
  <li>Are actions just wrapped protocol methods (is one built on top of other)?  </li>
  <li>What are the benefits and drawbacks of each?</li>
  </ol>