diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 9fb40ee..a30ac30 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -72,7 +72,7 @@ BB35ED6C21CB42AF00A63EEC /* FontOpenic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontOpenic.swift; sourceTree = ""; }; C06B66404DEACFB865299CF0031CA27D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; C08802B113FD67EC18F134F83FD56CF7 /* map-icons.ttf */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file; name = "map-icons.ttf"; path = "LGButton/Resources/map-icons.ttf"; sourceTree = ""; }; - C94B98552201D75000F284BD /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontAwesome.ttf; sourceTree = ""; }; + C94B98552201D75000F284BD /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesome.ttf; path = LGButton/Resources/FontAwesome.ttf; sourceTree = ""; }; CBC93E13272EFE886024A07D499B0036 /* LGButton.xib */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.xib; name = LGButton.xib; path = LGButton/Resources/LGButton.xib; sourceTree = ""; }; CCE5742C4865D28386BBC6726126293F /* Pods-LGButton_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-LGButton_Example-dummy.m"; sourceTree = ""; }; D16729AF393252BDF8C879F04B8A8B98 /* Pods-LGButton_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LGButton_Example-frameworks.sh"; sourceTree = ""; }; diff --git a/LGButton.podspec b/LGButton.podspec index 47eaa49..152be52 100644 --- a/LGButton.podspec +++ b/LGButton.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'LGButton' - s.version = '1.1.4' + s.version = '1.1.5' 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 7df2d04..3fcc27c 100644 --- a/LGButton/Classes/LGButton.swift +++ b/LGButton/Classes/LGButton.swift @@ -363,7 +363,7 @@ open class LGButton: UIControl { public var attributedString: NSAttributedString? { didSet { titleLbl.attributedText = attributedString - } + } } // MARK: - Overrides @@ -631,7 +631,7 @@ open class LGButton: UIControl { // MARK: - Xib file // MARK: fileprivate func xibSetup() { - guard rootView == nil else { return } + guard rootView == nil else { return } rootView = loadViewFromNib() rootView.frame = bounds rootView.autoresizingMask = [.flexibleWidth, .flexibleHeight] @@ -662,7 +662,6 @@ open class LGButton: UIControl { if !showTouchFeedback { return } - touchAlpha = (pressed) ? .touched : .untouched } } @@ -672,11 +671,10 @@ open class LGButton: UIControl { } override open func touchesEnded(_ touches: Set, with event: UIEvent?){ - let shouldSendActions = pressed - pressed = false - if shouldSendActions{ + if pressed { sendActions(for: .touchUpInside) } + pressed = false } override open func touchesMoved(_ touches: Set, with event: UIEvent?){ @@ -706,10 +704,12 @@ open class LGButton: UIControl { } @IBAction func tapAction(_ sender: Any) { - let shouldSendActions = pressed - pressed = false - if shouldSendActions{ - sendActions(for: .touchUpInside) + sendActions(for: .touchUpInside) + if !isLoading { + pressed = true + DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { + self.pressed = false + } } } } diff --git a/FontAwesome.ttf b/LGButton/Resources/FontAwesome.ttf similarity index 100% rename from FontAwesome.ttf rename to LGButton/Resources/FontAwesome.ttf diff --git a/README.md b/README.md index cf51760..322888c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Icons are managed by [SwiftIconFont](https://github.com/0x73/SwiftIconFont) inte | Collection | Font name | Cheat Sheet | |--------------|--------|-------------------------------------------| -| Font Awesome | fa | [List](http://fontawesome.io/cheatsheet/) | +| Font Awesome | fa | [List](https://fontawesome.com/v4.7.0/icons/) | | Ion Icons | io | [List](http://ionicons.com) | | Octicons | oc | [List](https://octicons.github.com) | | Open Iconic | ic | [List](https://useiconic.com/open/) |