title: iOS - extending two classes in one
body: <p>I have extended the UIVIewController class with several functions I want. </p>
  
  <p>I want to add the same functions to the UITableViewController class, I mean, to extend that class too.</p>
  
  <p>In order to do that I have to duplicate all the methods on the extended viewController class to a new pair of files that will be used to extend the tableViewController class. Sorry for my ignorance, but there's a way to extend both classes without that redundancy? I mean, to have just one generic extension class (?) that could be inherited by the viewController and tableViewController extension files? Sorry if this is confuse. What I mean is that instead of this:</p>
  
  <pre><code>UIViewController+extensions.h
  UIViewController+extensions.m
  </code></pre>
  
  <p>both containing a lot of extension methods for the UIViewController class and</p>
  
  <pre><code>UITableViewController+extensions.h
  UITableViewController+extensions.m
  </code></pre>
  
  <p>both containing a lot of extension methods for the UITableViewController class.</p>
  
  <p>I want this:</p>
  
  <pre><code>GenericExtension.h
  GenericExtension.m
  </code></pre>
  
  <p>This, containing the extension methods</p>
  
  <p>then,</p>
  
  <p>UIViewController+extension and UITableViewController+extension, both inheriting GenericExtension, so I have just one copy of the extension methods.</p>
  
  <p>Is that possible?</p>