diff --git a/Charts/Classes/Charts/BarLineChartViewBase.swift b/Charts/Classes/Charts/BarLineChartViewBase.swift index d73aed340f..f02bfc462b 100644 --- a/Charts/Classes/Charts/BarLineChartViewBase.swift +++ b/Charts/Classes/Charts/BarLineChartViewBase.swift @@ -984,12 +984,11 @@ public class BarLineChartViewBase: ChartViewBase, UIGestureRecognizerDelegate // If there is two scrollview together, we pick the superview of the inner scrollview. // In the case of UITableViewWrepperView, the superview will be UITableView - let superViewOfScrollView = scrollView?.superview - if (superViewOfScrollView!.isKindOfClass(UIScrollView)) + if let superViewOfScrollView = scrollView?.superview where superViewOfScrollView.isKindOfClass(UIScrollView) { scrollView = superViewOfScrollView } - + var foundScrollView = scrollView as? UIScrollView if (foundScrollView !== nil && !foundScrollView!.scrollEnabled)