Skip to content

Commit

Permalink
Merge branch 'release/1.1.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
loregr committed Mar 22, 2019
2 parents 8e93b6d + 7d3df53 commit 211b35b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion 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' }
Expand Down
23 changes: 14 additions & 9 deletions LGButton/Classes/LGButton.swift
Expand Up @@ -18,17 +18,16 @@ open class LGButton: UIControl {
}

let touchDisableRadius : CGFloat = 100.0

private var availableFontIcons: [String: IconFont] = ["fa": Fonts.awesome,
"io": Fonts.ion,
"oc": Fonts.oct,
"ic": Fonts.ic,
"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!
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -444,6 +445,8 @@ open class LGButton: UIControl {
}

fileprivate func setupBackgroundColor() {
bgContentWidthConstraint.constant = min(0, -borderWidth)
bgContentHeightConstraint.constant = min(0, -borderWidth)
bgContentView.backgroundColor = bgColor
}

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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(){
Expand Down
3 changes: 3 additions & 0 deletions LGButton/Resources/LGButton.xib
Expand Up @@ -4,13 +4,16 @@
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="LGButton" customModule="LGButton" customModuleProvider="target">
<connections>
<outlet property="bgContentHeightConstraint" destination="9Xz-q8-BM7" id="wve-iH-Jm8"/>
<outlet property="bgContentView" destination="Olz-81-yKk" id="bSa-ag-wmN"/>
<outlet property="bgContentWidthConstraint" destination="TJL-04-rYr" id="kVL-DP-eRv"/>
<outlet property="bottomMainConstraint" destination="Oni-YW-i3L" id="hxO-uS-Ijz"/>
<outlet property="leadingLoadingConstraint" destination="zf0-aD-IWu" id="3PH-T6-tpw"/>
<outlet property="leadingMainConstraint" destination="xxj-9X-oxK" id="BPi-O2-q2y"/>
Expand Down

0 comments on commit 211b35b

Please sign in to comment.