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

convert RunLoopMode to swift 3.0 syntax #1296

Merged
merged 1 commit into from
Aug 6, 2016
Merged
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
8 changes: 4 additions & 4 deletions Charts/Classes/Animation/ChartAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class ChartAnimator: NSObject
{
if (_displayLink != nil)
{
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
_displayLink = nil

_enabledX = false
Expand Down Expand Up @@ -196,7 +196,7 @@ public class ChartAnimator: NSObject
if (_enabledX || _enabledY)
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}
}

Expand Down Expand Up @@ -262,7 +262,7 @@ public class ChartAnimator: NSObject
if _displayLink === nil
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}
}
}
Expand Down Expand Up @@ -306,7 +306,7 @@ public class ChartAnimator: NSObject
if _displayLink === nil
{
_displayLink = NSUIDisplayLink(target: self, selector: #selector(ChartAnimator.animationLoop))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Charts/Classes/Charts/BarLineChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
_decelerationVelocity = recognizer.velocity(in: self)

_decelerationDisplayLink = NSUIDisplayLink(target: self, selector: #selector(BarLineChartViewBase.decelerationLoop))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}

_isDragging = false
Expand Down Expand Up @@ -875,7 +875,7 @@ public class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChar
{
if (_decelerationDisplayLink !== nil)
{
_decelerationDisplayLink.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_decelerationDisplayLink.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
_decelerationDisplayLink = nil
}
}
Expand Down
6 changes: 3 additions & 3 deletions Charts/Classes/Charts/PieRadarChartViewBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public class PieRadarChartViewBase: ChartViewBase
{
_decelerationLastTime = CACurrentMediaTime()
_decelerationDisplayLink = NSUIDisplayLink(target: self, selector: #selector(PieRadarChartViewBase.decelerationLoop))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}
}
}
Expand Down Expand Up @@ -788,7 +788,7 @@ public class PieRadarChartViewBase: ChartViewBase
{
if (_decelerationDisplayLink !== nil)
{
_decelerationDisplayLink.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_decelerationDisplayLink.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
_decelerationDisplayLink = nil
}
}
Expand Down Expand Up @@ -944,7 +944,7 @@ public class PieRadarChartViewBase: ChartViewBase
{
_decelerationLastTime = CACurrentMediaTime()
_decelerationDisplayLink = NSUIDisplayLink(target: self, selector: #selector(PieRadarChartViewBase.decelerationLoop))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_decelerationDisplayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Charts/Classes/Jobs/AnimatedViewPortJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ public class AnimatedViewPortJob: ChartViewPortJob
updateAnimationPhase(_startTime)

_displayLink = NSUIDisplayLink(target: self, selector: #selector(AnimatedViewPortJob.animationLoop))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.add(to: RunLoop.main, forMode: RunLoopMode.commonModes)
}

public func stop(finish: Bool)
{
if (_displayLink != nil)
{
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode(rawValue: RunLoopMode.commonModes.rawValue))
_displayLink.remove(from: RunLoop.main, forMode: RunLoopMode.commonModes)
_displayLink = nil

if finish
Expand Down
6 changes: 3 additions & 3 deletions Charts/Classes/Utils/ChartPlatform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,19 @@ types are aliased to either their UI* implementation (on iOS) or their NS* imple
stop()
}

public func add(to runloop: RunLoop, forMode: String)
public func add(to runloop: RunLoop, forMode: RunLoopMode)
{
if displayLink != nil
{
CVDisplayLinkStart(displayLink!)
}
else if timer != nil
{
runloop.add(timer!, forMode: RunLoopMode(rawValue: forMode))
runloop.add(timer!, forMode: forMode)
}
}

public func remove(from runloop: RunLoop, forMode: String)
public func remove(from runloop: RunLoop, forMode: RunLoopMode)
{
stop()
}
Expand Down