title: Subclassing ViewController Swift
body: <p>Sorry if the question has been ask before.. I have looked without finding it.</p>
  
  <p>I am building an IOS application with Swift2. I have a very long main class (ViewController: UIViewController).</p>
  
  <p>I am trying to reorganise my code by subclassing view controller in another two new classes Customer:Viewcontroller and Server:ViewController.</p>
  
  <p>My goal is that those two classed get executed adding extended functionality to me viewcontroller, and extension is not useful to me because I am overriding on the subclasses.</p>
  
  <p>How can I do to execute these classes when app lauched.</p>
  
  <p>Now my code is organised like this...</p>
  
  <pre><code>//ViewController handling now almost all my code
  class ViewController: UIViewController,UIImagePickerControllerDelegate,MPCManagerDelegate,UITableViewDelegate,UITableViewDataSource,UINavigationControllerDelegate {
  
  ///some variables 
  
  override func viewDidLoad() {
      super.viewDidLoad()
  ////some other stuff
  }
  ///some other functions
  }
  
  
  
  ///Server subclass My goal is to print ("subclassing after view controller 's didload function
  
  class server:ViewController {
  
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      print ("loaded extern class")
  }
  }
  </code></pre>
  
  <p>Thanks in advance</p>