From f026302a072bc8db36af0f18760516ab63f0c933 Mon Sep 17 00:00:00 2001 From: Xiaobin Chen Date: Fri, 9 Oct 2015 16:49:26 +0800 Subject: [PATCH] fix Scroll issue when the graph is in a UITableView --- Charts/Classes/Charts/BarLineChartViewBase.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Charts/Classes/Charts/BarLineChartViewBase.swift b/Charts/Classes/Charts/BarLineChartViewBase.swift index 1bd097251d..f02bfc462b 100644 --- a/Charts/Classes/Charts/BarLineChartViewBase.swift +++ b/Charts/Classes/Charts/BarLineChartViewBase.swift @@ -981,6 +981,14 @@ public class BarLineChartViewBase: ChartViewBase, UIGestureRecognizerDelegate { 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 where superViewOfScrollView.isKindOfClass(UIScrollView) + { + scrollView = superViewOfScrollView + } + var foundScrollView = scrollView as? UIScrollView if (foundScrollView !== nil && !foundScrollView!.scrollEnabled)