Skip to content

Commit

Permalink
Bug fix: fix NSLabel properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdiimrz committed Jul 12, 2021
1 parent 1521f50 commit b392436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/NetShears/Subclasses/NSLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import UIKit

final class NSLabel: UILabel {
@IBInspectable var padding: CGFloat = 0{
var borderColor : UIColor = UIColor.clear
var borderWidth : CGFloat = 0
var cornerRadius : CGFloat = 0
var padding: CGFloat = 0{
didSet {
self.textInsets = UIEdgeInsets(top: self.padding, left: self.padding, bottom: self.padding, right: self.padding)
}
Expand Down Expand Up @@ -40,7 +43,7 @@ final class NSLabel: UILabel {

func customize(){
self.layer.masksToBounds = true
self.layer.borderColor = self.borderColor?.cgColor
self.layer.borderColor = self.borderColor.cgColor
self.layer.borderWidth = self.borderWidth
self.layer.cornerRadius = self.cornerRadius
}
Expand Down

0 comments on commit b392436

Please sign in to comment.