Skip to content

Commit

Permalink
fix progress bug
Browse files Browse the repository at this point in the history
  • Loading branch information
carefree committed Jun 29, 2020
1 parent ddebbc3 commit 8cf1c4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion KFGradientProgressView.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "KFGradientProgressView"
s.version = "1.1.0"
s.version = "1.2.0"
s.summary = "一个简单的进度条控件"
s.homepage = "https://github.com/moliya/GradientProgressView"
s.license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pod 'KFGradientProgressView'

```swift
dependencies: [
.package(url: "https://github.com/moliya/GradientProgressView", from: "1.1.0")
.package(url: "https://github.com/moliya/GradientProgressView", from: "1.2.0")
]
```

3 changes: 3 additions & 0 deletions Sources/GradientProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ open class GradientProgressView: UIView {
CATransaction.setAnimationDuration(animated ? animationDuration : 0)
CATransaction.setAnimationTimingFunction(timingFunction)
CATransaction.setCompletionBlock {
//停止CADisplayLink
self.displayLink?.invalidate()
self.displayLink = nil
//保证最后的百分比正确
self.displayLinkAction()
}
defer {
CATransaction.commit()
Expand Down

0 comments on commit 8cf1c4c

Please sign in to comment.