title: How can I access to the methods of a class when there is multiple inheritance on Swift?
body: <p>I have a class that inherits from another class. </p>
  
  <pre><code>class Profile: UserData{
  }
  </code></pre>
  
  <p>And at the same time <code>UserData</code> inherits from <code>UIViewController</code>. </p>
  
  <p>The problem comes because I need that <code>Profile</code> class also inherits from <code>UITabBarController</code> and I need to access to the methods of <code>UserData</code> class from <code>Profile</code> class.</p>
  
  <p>What I have tried is:</p>
  
  <pre><code>class Profile: UITabBarController{
      override func viewDidLoad() {
          super.viewDidLoad()
  
          UserData().doStuff()
      }
  }
  </code></pre>
  
  <p>but this does not work for me because I need to inherit the full class (the method only works when I use <code>class Profile: UserData</code>).</p>
  
  <p>I know about protocols and I tried to inherit on the protocol the class <code>UserData</code> but it is also not allowed. I also have tried copying the methods of <code>UserData</code> class on that protocol but it gives to me the following error:</p>
  
  <blockquote>
    <p>Protocol methods may not have bodies</p>
  </blockquote>
  
  <p>As, by the moment, it is impossible to do multiple inheritance, is it possible to make a workaround to use all the methods of <code>UserData</code> (as if I have inherited it) on <code>Profile</code> class which inherits at the same time from <code>UITabBarController</code>?</p>
  
  <p>Thanks in advance!</p>