créer un UITableViewController par programmation dans Swift

J'essaie, comme le titre le dis, mettre en place un UITableViewController par programmation. Après quelques heures de l'essayer j'espère que quelqu'un pourra m'aider. Et, oui, je hve vérifié d'autres posts sur ce sujet:

import UIKit

class MainViewController: UITableViewController {

    init(style: UITableViewStyle) {
        super.init(style: style)
        //Custom initialization
    }

    override func viewDidLoad() {
        super.viewDidLoad()


    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        //Dispose of any resources that can be recreated.
    }

    //#pragma mark - Table view data source

    override func numberOfSectionsInTableView(tableView: UITableView?) -> Int {
        return 1
    }

    override func tableView(tableView: UITableView?, numberOfRowsInSection section: Int) -> Int {
        return 5
    }


    override func tableView(tableView: UITableView?, cellForRowAtIndexPath indexPath: NSIndexPath?) -> UITableViewCell? {
        var cell = tableView?.dequeueReusableCellWithIdentifier("Cell") as? UITableViewCell

        if !cell {
            cell = UITableViewCell(style: UITableViewCellStyle.Value1, reuseIdentifier: "Cell")
        }
        cell!.textLabel.text = "test"
        return cell
    }

}

et l'appDelegate ressemble à ceci:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
        self.window = UIWindow(frame: UIScreen.mainScreen().bounds)

        let mainViewController: UITableViewController = MainViewController(style: UITableViewStyle.Plain)
        let navigationController: UINavigationController = UINavigationController()
        navigationController.pushViewController(mainViewController, animated: false)

        self.window!.rootViewController = navigationController
        self.window!.backgroundColor = UIColor.whiteColor()
        self.window!.makeKeyAndVisible()
        return true
    }

Fonctionner le programme, mais dès qu'il fait, j'obtiens l'erreur suivante:

fatal error: use of unimplemented initializer 'init(nibName:bundle:)' for class 'HelloWorld.MainViewController'

Je modifie ensuite le MainViewController(style: UITableViewStyle.Plain) à MainViewController(nibName: nil, bundle: nil) mais puis-je obtenir suivantes erreur de syntaxe: Extra argument 'bundle' in call

Toute aide serait grandement appréciée

Comment êtes-vous la définition de la MainViewController classe?
Quelle est la définition pour MainViewController? Êtes-vous hériter directement de UITableViewController? Définissez-vous tout initialisers?
J'ai mis à jour le code

OriginalL'auteur Nilzone- | 2014-06-07