[ create a new paste ] login | about

Link: http://codepad.org/pLC05f3i    [ raw code | fork ]

cam - Plain Text, pasted on Jul 17:
//------changing button ui using code and changes at once

import UIKit
@IBDesignable

class RoundButton: UIButton {

    @IBInspectable var cornerRadius : CGFloat = 0 {
      
        didSet {
            self.layer.cornerRadius = cornerRadius
        }
    }
    
    @IBInspectable var borderWidth : CGFloat = 0 {
        
        didSet {
            self.layer.borderWidth = borderWidth
        }
    }
    
    @IBInspectable var borderColor : UIColor = UIColor.clear {
        
        didSet {
            self.layer.borderColor = borderColor.cgColor
        }
    }
}



Create a new paste based on this one


Comments: