Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated deprecated M_PI to Double.pi #30

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PullToRefreshSwift.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PullToRefreshSwift"
s.version = "3.0.3"
s.version = "3.0.4"
s.summary = "iOS Simple PullToRefresh Library."
s.homepage = "https://github.com/dekatotoro/PullToRefreshSwift"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
6 changes: 3 additions & 3 deletions Source/PullToRefreshView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ open class PullToRefreshView: UIView {
fileprivate var arrow: UIImageView
fileprivate var indicator: UIActivityIndicatorView
fileprivate var scrollViewInsets: UIEdgeInsets = UIEdgeInsets.zero
fileprivate var refreshCompletion: ((Void) -> Void)?
fileprivate var refreshCompletion: (() -> Void)?
fileprivate var pull: Bool = true

fileprivate var positionY:CGFloat = 0 {
Expand Down Expand Up @@ -78,7 +78,7 @@ open class PullToRefreshView: UIView {
fatalError("init(coder:) has not been implemented")
}

public init(options: PullToRefreshOption, frame: CGRect, refreshCompletion :((Void) -> Void)?, down:Bool=true) {
public init(options: PullToRefreshOption, frame: CGRect, refreshCompletion :(() -> Void)?, down:Bool=true) {
self.options = options
self.refreshCompletion = refreshCompletion

Expand Down Expand Up @@ -262,7 +262,7 @@ open class PullToRefreshView: UIView {
fileprivate func arrowRotation() {
UIView.animate(withDuration: 0.2, delay: 0, options:[], animations: {
// -0.0000001 for the rotation direction control
self.arrow.transform = CGAffineTransform(rotationAngle: CGFloat(M_PI-0.0000001))
self.arrow.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi-0.0000001))
}, completion:nil)
}

Expand Down
4 changes: 2 additions & 2 deletions Source/UIScrollViewExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ public extension UIScrollView {
return pullToRefreshView as? PullToRefreshView
}

public func addPullRefresh(options: PullToRefreshOption = PullToRefreshOption(), refreshCompletion :((Void) -> Void)?) {
public func addPullRefresh(options: PullToRefreshOption = PullToRefreshOption(), refreshCompletion :(() -> Void)?) {
let refreshViewFrame = CGRect(x: 0, y: -PullToRefreshConst.height, width: self.frame.size.width, height: PullToRefreshConst.height)
let refreshView = PullToRefreshView(options: options, frame: refreshViewFrame, refreshCompletion: refreshCompletion)
refreshView.tag = PullToRefreshConst.pullTag
addSubview(refreshView)
}

public func addPushRefresh(options: PullToRefreshOption = PullToRefreshOption(), refreshCompletion :((Void) -> Void)?) {
public func addPushRefresh(options: PullToRefreshOption = PullToRefreshOption(), refreshCompletion :(() -> Void)?) {
let refreshViewFrame = CGRect(x: 0, y: contentSize.height, width: self.frame.size.width, height: PullToRefreshConst.height)
let refreshView = PullToRefreshView(options: options, frame: refreshViewFrame, refreshCompletion: refreshCompletion,down: false)
refreshView.tag = PullToRefreshConst.pushTag
Expand Down