title: Use function from one class in another class in Swift
body: <p>So lets say I have a class called Math</p>
  
  <pre><code>class Math{
  
      func add(numberOne: Int, numberTwo: Int) -&gt; Int{
  
          var answer: Int = numberOne + numberTwo
          return answer
      }
  </code></pre>
  
  <p>In this class there is a function which allows the user to add two numbers.</p>
  
  <p>I now have another class which is a subclass of a UIViewController and I want to use the add function from the Math class, how do I do this?</p>
  
  <pre><code>class myViewController: UIViewController{
  
      //Math.add()???
  
  }
  </code></pre>