【发布时间】:2014-10-30 13:19:04
【问题描述】:
self.view 出错,提示“UIViewController.Type”没有名为“view”的成员
extension UIViewController {
class func addBackgroundImage() {
let backgroundImageView = UIImageView();
let backgroundImage = UIImage(named: "splashBackground");
backgroundImageView.image = backgroundImage;
self.view.addSubview(backgroundImageView);
let insets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
backgroundImageView.autoPinEdgesToSuperviewEdgesWithInsets(insets)
}
【问题讨论】:
标签: ios swift uiviewcontroller