Skip to content

Commit 3d1465a

Browse files
Fixed minor typo error.
1 parent a8eee7f commit 3d1465a

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ SSSpinnerButton is an elegant button with a diffrent spinner animations.
4343

4444
**StartAnimation**
4545

46-
button.startAnimate(spinnerType: SpinnerType.ballClipRotate, spinnercolor: UIColor.red, complate: nil)
46+
button.startAnimate(spinnerType: SpinnerType.ballClipRotate, spinnercolor: UIColor.red, complete: nil)
4747

4848

4949
**StopAnimation**
5050

51-
button.stopAnimate(complate: {
51+
button.stopAnimate(complete: {
5252
})
5353

5454

SSSpinnerButton/SSSpinnerButton/SpinnerButton/SSSpinnerButton.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ public extension SSSpinnerButton {
135135
/// - Parameters:
136136
/// - spinnerType: spinner Type ( ballClipRotate(default), ballSpinFade, lineSpinFade, circleStrokeSpin, ballRotateChase)
137137
/// - spinnercolor: color of spinner (default = gray)
138-
/// - complate: complation block (call after animation start)
139-
public func startAnimate(spinnerType: SpinnerType = .ballClipRotate, spinnercolor: UIColor = .gray, complate: (() -> Void)?) {
138+
/// - complete: complation block (call after animation start)
139+
public func startAnimate(spinnerType: SpinnerType = .ballClipRotate, spinnercolor: UIColor = .gray, complete: (() -> Void)?) {
140140
if self.cornrRadius == 0 {
141141
self.cornrRadius = self.layer.cornerRadius
142142
}
@@ -147,17 +147,17 @@ public extension SSSpinnerButton {
147147
self.spinnerType = spinnerType
148148

149149
self.layer.cornerRadius = self.frame.height / 2
150-
self.collapseAnimation(complate: complate)
150+
self.collapseAnimation(complete: complete)
151151

152152
}
153153

154154
/// stop Animation and set button in actual state
155155
///
156-
/// - Parameter complate: complation block (call after animation Stop)
157-
public func stopAnimate(complate: (() -> Void)?) {
156+
/// - Parameter complete: complation block (call after animation Stop)
157+
public func stopAnimate(complete: (() -> Void)?) {
158158

159159
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
160-
self.backToDefaults(complate: complate)
160+
self.backToDefaults(complete: complete)
161161
})
162162

163163
}
@@ -175,7 +175,7 @@ private extension SSSpinnerButton {
175175
}
176176

177177
/// collapse animation
178-
func collapseAnimation(complate: (() -> Void)?) {
178+
func collapseAnimation(complete: (() -> Void)?) {
179179

180180
storedTitle = title
181181
title = ""
@@ -203,15 +203,15 @@ private extension SSSpinnerButton {
203203
self.perform(#selector(startSpinner), with: nil, afterDelay: animationDuration)
204204

205205
DispatchQueue.main.asyncAfter(deadline: .now() + animationDuration, execute: {
206-
if complate != nil {
207-
complate!()
206+
if complete != nil {
207+
complete!()
208208
}
209209
})
210210

211211
}
212212

213213
/// set back to default state of button
214-
func backToDefaults(complate: (() -> Void)?) {
214+
func backToDefaults(complete: (() -> Void)?) {
215215
if !isAnimating {
216216
return
217217
}
@@ -238,8 +238,8 @@ private extension SSSpinnerButton {
238238
layer.add(animaton, forKey: animaton.keyPath)
239239
isAnimating = false
240240
self.layer.cornerRadius = self.cornrRadius
241-
if complate != nil {
242-
complate!()
241+
if complete != nil {
242+
complete!()
243243
}
244244

245245
}

SSSpinnerButton/ViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class ViewController: UIViewController {
3131

3232
let arr: [SpinnerType] = [.ballClipRotate, .ballSpinFade, .lineSpinFade, .ballRotateChase, .circleStrokeSpin]
3333

34-
sender.startAnimate(spinnerType: arr[sender.tag], spinnercolor: .white, complate: nil)
34+
sender.startAnimate(spinnerType: arr[sender.tag], spinnercolor: .white, complete: nil)
3535

3636
Timer.scheduledTimer(withTimeInterval: 5, repeats: false) { (_) in
37-
sender.stopAnimate(complate: {
37+
sender.stopAnimate(complete: {
3838
})
3939

4040
}

0 commit comments

Comments
 (0)