title: How can I chain functions and choose which one to execute in Swift?
body: <p>I want to be able to chain functions as seen below and choose between them. In this contrived example, I hardcoded "function_b", but in the ideal world, I'd like it to be random or even controlled by a server. I know that I can create the same effect in different ways, but I like the way this code reads, so I want to do it like this.</p>
  
  <pre><code>ExecutionManager("function_b").add("function_a") {
      //some code
  }.add("function_b") {
      //more code
  }.add("function_c") {
      //other code
  }
  </code></pre>