【发布时间】:2016-09-20 23:57:02
【问题描述】:
我正在使用带有自定义 XIB 的情节提要,在升级到 swift 2 和 xcode 7 之前一切正常。升级后可以将情节提要转换为 xcode 8。我的视图控制器显示视图,但缺少我的自定义 XIB .查看情节提要文件,使用自定义 XIB 转换情节提要似乎存在错误。其他人有这个问题吗?
required public init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
let bundle = Bundle(for: type(of: self))
let nib = UINib(nibName: self.dynamicTypeName, bundle: bundle)
let nibView = nib.instantiate(withOwner: self, options: nil).first as! UIView
self.mainView = nibView
self.mainView.frame = bounds
self.mainView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
mainView.translatesAutoresizingMaskIntoConstraints = true
self.addSubview(mainView)
}
【问题讨论】:
标签: ios iphone xcode swift3 xcode8