Created
          December 10, 2018 06:15 
        
      - 
      
- 
        Save smhemel/1cb0e15fde4eb8694719f9996c74ce35 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // This file add your project and customize your Label. | |
| import UIKit | |
| @IBDesignable | |
| class UILabelX: UILabel { | |
| @IBInspectable var cornerRadius: CGFloat = 0 { | |
| didSet { | |
| self.layer.cornerRadius = cornerRadius | |
| } | |
| } | |
| @IBInspectable var borderWidth: CGFloat = 0.0 { | |
| didSet { | |
| self.layer.borderWidth = borderWidth | |
| } | |
| } | |
| @IBInspectable var borderColor: UIColor = UIColor.clear { | |
| didSet { | |
| self.layer.borderColor = borderColor.cgColor | |
| } | |
| } | |
| @IBInspectable var rotationAngle: CGFloat = 0 { | |
| didSet { | |
| self.transform = CGAffineTransform(rotationAngle: rotationAngle * .pi / 180) | |
| } | |
| } | |
| // MARK: - Shadow Text Properties | |
| @IBInspectable public var shadowOpacity: CGFloat = 0 { | |
| didSet { | |
| layer.shadowOpacity = Float(shadowOpacity) | |
| } | |
| } | |
| @IBInspectable public var shadowColorLayer: UIColor = UIColor.clear { | |
| didSet { | |
| layer.shadowColor = shadowColorLayer.cgColor | |
| } | |
| } | |
| @IBInspectable public var shadowRadius: CGFloat = 0 { | |
| didSet { | |
| layer.shadowRadius = shadowRadius | |
| } | |
| } | |
| @IBInspectable public var shadowOffsetLayer: CGSize = CGSize(width: 0, height: 0) { | |
| didSet { | |
| layer.shadowOffset = shadowOffsetLayer | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment