Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
carefree committed Jul 8, 2020
1 parent aad6261 commit 7b24072
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.3.0"
s.version = "1.4.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.3.0")
.package(url: "https://github.com/moliya/GradientProgressView", from: "1.4.0")
]
```

8 changes: 7 additions & 1 deletion Sources/GradientProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ open class GradientProgressView: UIView {
//开启CADisplayLink
displayLink = CADisplayLink(target: self, selector: #selector(displayLinkAction))
//使用common模式,使其在UIScrollView滑动时依然能得到回调
displayLink?.add(to: .current, forMode: .common)
displayLink?.add(to: .main, forMode: .common)
}

CATransaction.begin()
Expand All @@ -143,6 +143,12 @@ open class GradientProgressView: UIView {
if duration == 0 {
//更新回调
self.progressUpdating?(validProgress, self.maskLayer.frame)
} else {
if let _ = self.maskLayer.presentation() {
self.displayLinkAction()
} else {
self.progressUpdating?(validProgress, self.maskLayer.frame)
}
}
}

Expand Down

0 comments on commit 7b24072

Please sign in to comment.