ranjithkumar-m
11/19/2017 - 8:29 AM

UIView - BoilerPlate

override var frame: CGRect {
        didSet {
            updateView()
        }
    }
    
    init() {
        super.init(frame: CGRect.init())
        setupView()
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupView() {
        //All the custom initialisation goes here
        updateView()
    }
    
    private func updateView() {
        //All the frame related things goes here.
    }