Skip to content

Commit 2005d75

Browse files
Merge pull request #15 from simformsolutions/develop
Develop
2 parents 4fb70d3 + c03fe44 commit 2005d75

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

SSSpinnerButton.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = "SSSpinnerButton"
11-
s.version = "1.1.0"
11+
s.version = "1.1.1"
1212
s.summary = "SSSpinnerButton is an elegant button with a different spinner animations."
1313

1414
#s.description = "SSSpinnerButton is an elegant button with a different spinner animations."

SSSpinnerButton.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
/* Begin PBXBuildFile section */
1010
5189267820C96E9F0016E3A0 /* SSFailMark.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5189267720C96E9F0016E3A0 /* SSFailMark.swift */; };
11-
519A451220C6A0FD00BD9352 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 51AAA5E420C64ED3000F4BCD /* Info.plist */; };
1211
519A451320C6A15D00BD9352 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 51AAA5DC20C64ED3000F4BCD /* Main.storyboard */; };
1312
51AAA5D920C64ED3000F4BCD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51AAA5D820C64ED3000F4BCD /* AppDelegate.swift */; };
1413
51AAA5DB20C64ED3000F4BCD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51AAA5DA20C64ED3000F4BCD /* ViewController.swift */; };
@@ -214,7 +213,6 @@
214213
519A451320C6A15D00BD9352 /* Main.storyboard in Resources */,
215214
51AAA5E320C64ED3000F4BCD /* LaunchScreen.storyboard in Resources */,
216215
51AAA5E020C64ED3000F4BCD /* Assets.xcassets in Resources */,
217-
519A451220C6A0FD00BD9352 /* Info.plist in Resources */,
218216
);
219217
runOnlyForDeploymentPostprocessing = 0;
220218
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

SSSpinnerButton/SSSpinnerButton/SpinnerButton/SSSpinnerButton.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public enum CompletionType {
2727
open class SSSpinnerButton: UIButton {
2828
// MARK: - Properties
2929
internal var storedTitle: String?
30+
internal var storedAttributedTitle: NSAttributedString?
3031
internal var storedBackgroundNormalImage: UIImage?
3132
internal var storedBackgroundSelectedImage: UIImage?
3233
internal var storedBackgroundDisabledImage: UIImage?
@@ -63,6 +64,16 @@ open class SSSpinnerButton: UIButton {
6364
}
6465
}
6566

67+
68+
/// Sets the button attributed title for its normal state
69+
public var attributedTitle: NSAttributedString? {
70+
get {
71+
return self.attributedTitle(for: .normal)
72+
} set {
73+
self.setAttributedTitle(newValue, for: .normal)
74+
}
75+
}
76+
6677
/// Sets the button title color.
6778
public var titleColor: UIColor? {
6879
get {
@@ -224,6 +235,9 @@ private extension SSSpinnerButton {
224235

225236
storedTitle = title
226237
title = ""
238+
239+
storedAttributedTitle = attributedTitle
240+
attributedTitle = nil
227241
storedBackgroundNormalImage = self.backgroundImage(for: .normal)
228242
storedBackgroundDisabledImage = self.backgroundImage(for: .disabled)
229243
storedBackgroundSelectedImage = self.backgroundImage(for: .selected)
@@ -299,6 +313,9 @@ private extension SSSpinnerButton {
299313
func setDefaultDataToButton(complete: (() -> Void)?) {
300314
self.removeAnimationLayer()
301315
setTitle(storedTitle, for: .normal)
316+
if self.storedAttributedTitle != nil {
317+
self.setAttributedTitle(self.storedAttributedTitle, for: .normal)
318+
}
302319
self.setBackgroundImage(self.storedBackgroundNormalImage, for: .normal)
303320
self.setBackgroundImage(self.storedBackgroundDisabledImage, for: .disabled)
304321
self.setBackgroundImage(self.storedBackgroundSelectedImage, for: .selected)

SSSpinnerButton/ViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ViewController: UIViewController {
3030

3131
@IBAction func onSpinnnerButtonClick(_ sender: SSSpinnerButton) {
3232

33+
3334
let arr: [SpinnerType] = [.ballClipRotate, .ballSpinFade, .lineSpinFade, .ballRotateChase, .circleStrokeSpin, .ballClipRotate, .ballSpinFade, .lineSpinFade, .ballRotateChase, .circleStrokeSpin]
3435

3536
// MARK: Start Animating

0 commit comments

Comments
 (0)