Are view controllers with nib files broken in ios 8 beta 5?

前端 未结 7 1963
囚心锁ツ
囚心锁ツ 2020-12-01 21:46

I created a test project in ios 8 beta 4 which as a main view controller and a second view controller created as a UIViewController subclass with a xib file.

I put a

7条回答
  •  心在旅途
    2020-12-01 22:09

    Swift3:

    extension UIViewController {
        static func instanceWithDefaultNib() -> Self {
            let className = NSStringFromClass(self).components(separatedBy: ".").last
            return self.init(nibName: className, bundle: nil)
        }
    }
    

提交回复
热议问题