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

Removed isKind(of:) #3044

Merged
merged 1 commit into from Dec 5, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 8 additions & 11 deletions Source/Charts/Charts/BarLineChartViewBase.swift
Expand Up @@ -913,30 +913,27 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD
open func gestureRecognizer(_ gestureRecognizer: NSUIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: NSUIGestureRecognizer) -> Bool
{
#if !os(tvOS)
if ((gestureRecognizer.isKind(of: NSUIPinchGestureRecognizer.self) &&
otherGestureRecognizer.isKind(of: NSUIPanGestureRecognizer.self)) ||
(gestureRecognizer.isKind(of: NSUIPanGestureRecognizer.self) &&
otherGestureRecognizer.isKind(of: NSUIPinchGestureRecognizer.self)))
if ((gestureRecognizer is NSUIPinchGestureRecognizer && otherGestureRecognizer is NSUIPanGestureRecognizer) ||
(gestureRecognizer is NSUIPanGestureRecognizer && otherGestureRecognizer is NSUIPinchGestureRecognizer))
{
return true
}
#endif

if (gestureRecognizer.isKind(of: NSUIPanGestureRecognizer.self) &&
otherGestureRecognizer.isKind(of: NSUIPanGestureRecognizer.self) && (
gestureRecognizer == _panGestureRecognizer
))
if gestureRecognizer is NSUIPanGestureRecognizer,
otherGestureRecognizer is NSUIPanGestureRecognizer,
gestureRecognizer == _panGestureRecognizer
{
var scrollView = self.superview
while !(scrollView?.isKind(of: NSUIScrollView.self) ?? true)
while !(scrollView is NSUIScrollView)
{
scrollView = scrollView?.superview
}

// If there is two scrollview together, we pick the superview of the inner scrollview.
// In the case of UITableViewWrepperView, the superview will be UITableView
if let superViewOfScrollView = scrollView?.superview
, superViewOfScrollView.isKind(of: NSUIScrollView.self)
if let superViewOfScrollView = scrollView?.superview,
superViewOfScrollView is NSUIScrollView
{
scrollView = superViewOfScrollView
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Charts/Charts/PieRadarChartViewBase.swift
Expand Up @@ -226,7 +226,7 @@ open class PieRadarChartViewBase: ChartViewBase

var minOffset = self.minOffset

if (self.isKind(of: RadarChartView.self))
if self is RadarChartView
{
let x = self.xAxis

Expand Down