From 101e1422f3595716d0c560dcd6677ef3409d8185 Mon Sep 17 00:00:00 2001 From: "Khan, Arshad" Date: Thu, 8 Oct 2020 21:01:55 +0530 Subject: [PATCH] scroll view indicator fix for defect: CXTDT-82115 --- MVMCoreUI/BaseControllers/ScrollingViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MVMCoreUI/BaseControllers/ScrollingViewController.swift b/MVMCoreUI/BaseControllers/ScrollingViewController.swift index eb1d5999..7b368e2a 100644 --- a/MVMCoreUI/BaseControllers/ScrollingViewController.swift +++ b/MVMCoreUI/BaseControllers/ScrollingViewController.swift @@ -50,6 +50,14 @@ open class ScrollingViewController: ViewController { dismissKeyboardTapGesture?.isEnabled = false scrollView.alwaysBounceVertical = false scrollView.delegate = self + // will change scrollView indicatorStyle automatically on the basis of backgroundColor + var componentWhite:CGFloat = 0 + var componentAlpha:CGFloat = 0 + if let grayScale = view.backgroundColor?.getWhite(&componentWhite, alpha: &componentAlpha), grayScale + { + scrollView.indicatorStyle = componentWhite > 0 ? .black : .white + } + scrollView.flashScrollIndicators() } open override func viewDidLayoutSubviews() {