未显示自定义 UIViewController 的视图

Custom UIViewController's view is not being shown

所以我有这个视图控制器,它有一个 xib 文件,我检查了文件的所有者和视图插座,class 和 xib 文件都已连接。但是如果我想推送这个视图控制器,它会显示一个空的,即使它的所有方法都被调用:viewDidLoadviewWillAppear

self.navigationController?.presentViewController(
  TourViewController(nibName: "TourViewController", bundle: nil), animated: false, completion: nil
)

这是视图控制器:

class TourViewController: TLViewController {

  override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
    super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    println("nib init")
  }

  required init(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
  }

  override func viewDidLoad() {
    super.viewDidLoad()
    println("didLoad")

  }

  override func viewWillAppear(animated: Bool) {
    super.viewWillAppear(animated)

    println("appear")
  }

}

我更改了颜色背景,还为 XIB 添加了标签

嗯,问题出在我的 CUSTOM TLViewController

override func loadView() {
    super.loadView()

    screen = UIScreen.mainScreen().bounds
    visibleFrame = CGRectMake(
      0.0,
      20.0 + 44.0,
      screen.size.width,
      screen.size.height - (20.0 + 44.0)
    )

    view = UIView(frame: screen)
    view.backgroundColor = UIColor.whiteColor()

    self.navigationController?.navigationBar.barTintColor = UIColor.whiteColor()
    self.navigationController?.navigationBar.tintColor = UIColor.backgroundMenu()
    self.navigationController?.navigationBar.titleTextAttributes =
      [NSForegroundColorAttributeName: UIColor.backgroundMenu()]
    // Back Button
    self.navigationItem.backBarButtonItem = UIBarButtonItem(title: "",
      style: .Plain, target: nil, action: nil)

    var menuBtn = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
    menuBtn.setImage(UIImage(named: "menu-ico"), forState: UIControlState.Normal)
    menuBtn.addTarget(self, action: Selector("menu"), forControlEvents:  UIControlEvents.TouchUpInside)
    leftMenuButtonItem = UIBarButtonItem(customView: menuBtn)
  }

所以我改变了

class TourViewController: TLViewController 

class TourViewController: UIViewController