美文网首页程序员
swift - xib加载View

swift - xib加载View

作者: biubiuboom | 来源:发表于2020-05-13 12:06 被阅读0次

//xib 加载View

 override init(frame: CGRect) {
        super.init(frame: frame)
        let contentView = Bundle.main.loadNibNamed("JKLiveShareView", owner: self, options: nil)?.first as! UIView
        contentView.frame = frame
        self.addSubview(contentView)
        UIApplication.shared.keyWindow?.addSubview(self)
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    

相关文章

网友评论

    本文标题:swift - xib加载View

    本文链接:https://www.haomeiwen.com/subject/igzdnhtx.html