title: Set breakpoint on protocol method
body: <p>Basically I need to set a breakpoint on a protocol method in order to catch all calls to objects conforming to that protocol. I have a custom framework with lots of classes conforming to the protocol, so manually setting a breakpoint on every class is not feasible.</p>
  
  <p>I tried setting the breakpoint from the Xcode editor:</p>
  
  <p><a href="https://i.stack.imgur.com/URprx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/URprx.png" alt="enter image description here"></a></p>
  
  <p>, however when setting the breakpoint I get only breakpoints for the allocation methods:
  <a href="https://i.stack.imgur.com/KaZcC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KaZcC.png" alt="allocation breakpoints"></a></p>
  
  <p>, and as expected the debugger doesn't stop when <code>doSomething()</code> is called.</p>
  
  <p>I also tried adding symbolic breakpoints, no luck here too:
  <a href="https://i.stack.imgur.com/LPGiT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPGiT.png" alt="enter image description here"></a></p>
  
  <p>Here's some demo code to illustrate this:</p>
  
  <pre><code>protocol TestProtocol {
      func doSomething()
      func doAnotherThing()
  }
  
  class TestConformingClass: TestProtocol {
      func doSomething() {
          print("Yay")
      }
  
      func doAnotherThing() {
          print("Hooray")
      }
  }
  </code></pre>
  
  <p>Is there a way to intercept all calls to a method that is part of a protocol requirements list?</p>