diff --git a/LGButton.podspec b/LGButton.podspec
index 152be52..fb72c4a 100644
--- a/LGButton.podspec
+++ b/LGButton.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LGButton'
- s.version = '1.1.5'
+ s.version = '1.1.6'
s.summary = 'A fully customisable subclass of the native UIControl which allows you to create beautiful buttons without writing any line of code.'
s.homepage = 'https://cocoapods.org/pods/LGButton'
s.license = { :type => 'MIT', :file => 'LICENSE.md' }
diff --git a/LGButton/Classes/LGButton.swift b/LGButton/Classes/LGButton.swift
index 3fcc27c..09cc0d6 100644
--- a/LGButton/Classes/LGButton.swift
+++ b/LGButton/Classes/LGButton.swift
@@ -18,7 +18,7 @@ open class LGButton: UIControl {
}
let touchDisableRadius : CGFloat = 100.0
-
+
private var availableFontIcons: [String: IconFont] = ["fa": Fonts.awesome,
"io": Fonts.ion,
"oc": Fonts.oct,
@@ -26,9 +26,8 @@ open class LGButton: UIControl {
"ma": Fonts.material,
"ti": Fonts.themify,
"mi": Fonts.map]
-
- var gradient : CAGradientLayer?
+ fileprivate var gradient : CAGradientLayer?
fileprivate var rootView : UIView!
@IBOutlet fileprivate weak var titleLbl: UILabel!
@@ -56,6 +55,8 @@ open class LGButton: UIControl {
@IBOutlet fileprivate var trailingLoadingConstraint: NSLayoutConstraint!
@IBOutlet fileprivate var leadingLoadingConstraint: NSLayoutConstraint!
+ @IBOutlet weak var bgContentWidthConstraint: NSLayoutConstraint!
+ @IBOutlet weak var bgContentHeightConstraint: NSLayoutConstraint!
public var isLoading = false {
didSet {
@@ -444,6 +445,8 @@ open class LGButton: UIControl {
}
fileprivate func setupBackgroundColor() {
+ bgContentWidthConstraint.constant = min(0, -borderWidth)
+ bgContentHeightConstraint.constant = min(0, -borderWidth)
bgContentView.backgroundColor = bgColor
}
@@ -482,8 +485,8 @@ open class LGButton: UIControl {
bgContentView.layer.cornerRadius = cornerRadius
layer.cornerRadius = cornerRadius
}
- bgContentView.layer.borderColor = borderColor.cgColor
- bgContentView.layer.borderWidth = borderWidth
+ self.layer.borderColor = borderColor.cgColor
+ self.layer.borderWidth = borderWidth
}
fileprivate func setupTitle() {
@@ -547,10 +550,12 @@ open class LGButton: UIControl {
}
fileprivate func setupShadow(){
- layer.shadowOffset = shadowOffset
- layer.shadowRadius = shadowRadius
- layer.shadowOpacity = Float(shadowOpacity)
- layer.shadowColor = shadowColor.cgColor
+ if shadowRadius > 0 {
+ layer.shadowOffset = shadowOffset
+ layer.shadowRadius = shadowRadius
+ layer.shadowOpacity = Float(shadowOpacity)
+ layer.shadowColor = shadowColor.cgColor
+ }
}
fileprivate func setupLoadingView(){
diff --git a/LGButton/Resources/LGButton.xib b/LGButton/Resources/LGButton.xib
index 7a7f2fc..141c0b5 100644
--- a/LGButton/Resources/LGButton.xib
+++ b/LGButton/Resources/LGButton.xib
@@ -4,13 +4,16 @@
+
+
+