From 8b0ab45d189b0a08a2a1783d6cd3d97cc8d55920 Mon Sep 17 00:00:00 2001 From: Lorenzo Greco Date: Tue, 29 Jan 2019 11:12:44 +0100 Subject: [PATCH 1/2] Changed public to open to allow subclassing --- LGButton/Classes/LGButton.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/LGButton/Classes/LGButton.swift b/LGButton/Classes/LGButton.swift index b0b3ca9..7df2d04 100644 --- a/LGButton/Classes/LGButton.swift +++ b/LGButton/Classes/LGButton.swift @@ -10,7 +10,7 @@ import QuartzCore @IBDesignable -public class LGButton: UIControl { +open class LGButton: UIControl { enum TouchAlphaValues : CGFloat { case touched = 0.7 @@ -382,7 +382,7 @@ public class LGButton: UIControl { setupView() } - override public func layoutSubviews() { + override open func layoutSubviews() { if gradient != nil { gradient?.removeFromSuperlayer() gradient = nil @@ -391,19 +391,19 @@ public class LGButton: UIControl { setupBorderAndCorners() } - override public func awakeFromNib() { + override open func awakeFromNib() { super.awakeFromNib() xibSetup() setupView() } - override public func prepareForInterfaceBuilder() { + override open func prepareForInterfaceBuilder() { super.prepareForInterfaceBuilder() xibSetup() setupView() } - override public var intrinsicContentSize: CGSize { + override open var intrinsicContentSize: CGSize { return CGSize(width: 10, height: 10) } @@ -667,11 +667,11 @@ public class LGButton: UIControl { } } - override public func touchesBegan(_ touches: Set, with event: UIEvent?){ + override open func touchesBegan(_ touches: Set, with event: UIEvent?){ pressed = true } - override public func touchesEnded(_ touches: Set, with event: UIEvent?){ + override open func touchesEnded(_ touches: Set, with event: UIEvent?){ let shouldSendActions = pressed pressed = false if shouldSendActions{ @@ -679,7 +679,7 @@ public class LGButton: UIControl { } } - override public func touchesMoved(_ touches: Set, with event: UIEvent?){ + override open func touchesMoved(_ touches: Set, with event: UIEvent?){ if let touchLoc = touches.first?.location(in: self){ if (touchLoc.x < -touchDisableRadius || touchLoc.y < -touchDisableRadius || @@ -693,7 +693,7 @@ public class LGButton: UIControl { } } - override public func touchesCancelled(_ touches: Set, with event: UIEvent?) { + override open func touchesCancelled(_ touches: Set, with event: UIEvent?) { pressed = false } From e2dbf934198935663ca273c17376c60e97254e92 Mon Sep 17 00:00:00 2001 From: Lorenzo Greco Date: Tue, 29 Jan 2019 11:13:33 +0100 Subject: [PATCH 2/2] Version bump --- LGButton.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LGButton.podspec b/LGButton.podspec index ee4ad2d..f2dea2f 100644 --- a/LGButton.podspec +++ b/LGButton.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LGButton' - s.version = '1.1.2' + s.version = '1.1.3' 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' }