程序员

swift - xib加载View

2020-05-13  本文已影响0人  biubiuboom

//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")
    }
    
上一篇 下一篇

猜你喜欢

热点阅读