title: Array of pointer to methods in swift
body: <p>I'm looking for a way to do something like an array of pointer to methods in C++ or an array of selector in objective-c.</p>
  
  <p>With a class named <code>A</code> :</p>
  
  <pre><code>class A
  {
      func function1() -&gt; Int
      {
          // Do something cool here
          return 0;
      }
  
      func function2() -&gt; Int
      {
          // Do something cool here
          return 1;
      }
  }
  </code></pre>
  
  <p>I want to create an array of methods and call one of them using the index.</p>
  
  <p>Here is an exemple of what I want to do with pseudo swift code :</p>
  
  <pre><code>let arr = [function1, function2 ]
  arr[0]()
  </code></pre>