Skip to content

Commit 8cf1c4c

Browse files
author
carefree
committed
fix progress bug
1 parent ddebbc3 commit 8cf1c4c

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

KFGradientProgressView.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "KFGradientProgressView"
4-
s.version = "1.1.0"
4+
s.version = "1.2.0"
55
s.summary = "一个简单的进度条控件"
66
s.homepage = "https://github.com/moliya/GradientProgressView"
77
s.license = "MIT"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pod 'KFGradientProgressView'
8989

9090
```swift
9191
dependencies: [
92-
.package(url: "https://github.com/moliya/GradientProgressView", from: "1.1.0")
92+
.package(url: "https://github.com/moliya/GradientProgressView", from: "1.2.0")
9393
]
9494
```
9595

Sources/GradientProgressView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ open class GradientProgressView: UIView {
131131
CATransaction.setAnimationDuration(animated ? animationDuration : 0)
132132
CATransaction.setAnimationTimingFunction(timingFunction)
133133
CATransaction.setCompletionBlock {
134+
//停止CADisplayLink
134135
self.displayLink?.invalidate()
135136
self.displayLink = nil
137+
//保证最后的百分比正确
138+
self.displayLinkAction()
136139
}
137140
defer {
138141
CATransaction.commit()

0 commit comments

Comments
 (0)