ITeye博客

[转载]集成UIView

2014马年 · 2016-04-16 21:42 · 代码片段 · 移动开发 · Markdown

来源:

 

http://stackoverflow.com/a/27057168/2967461

 

 

class MyView: UIView {
    override init (frame : CGRect) {
        super.init(frame : frame)
        addBehavior()
    }

    convenience init () {
        self.init(frame:CGRect.zero)
    }

    required init(coder aDecoder: NSCoder) {
        fatalError("This class does not support NSCoding")
    }

    func addBehavior (){
        print("Add all the behavior here")
    }
}



let u = MyView(frame: CGRect.zero)
let v = MyView()

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。