title: run function depending on passed integer in swift
body: <p>I want to run different functions depending on selected level Integer
  so if selected level is 1 then runfunc1(), if 2 then runfunc2()...
  I know this is possible using if else</p>
  
  <pre><code>if levelselected == 1 {
      runfunc1()
  } else if levelseletecd == 2 {
      runfunc2()
      // ... and so on
  }
  </code></pre>
  
  <p>Is there any better way than this, perhaps something like this</p>
  
  <pre><code>runfunc%i(),levelselected // I know its not correct but something similar
  </code></pre>
  
  <p>I dont want to write new code for every level, so any better way?</p>