From a874a14fbf89199e6df8c3b88f6f5c52f14000fc Mon Sep 17 00:00:00 2001 From: Dmitrii Medvedev Date: Sat, 3 Jun 2023 21:28:17 +0300 Subject: [PATCH] Fix crash when set up scroll bar before first scroll view layoutSubviews --- DMScrollBar/DMScrollBar.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/DMScrollBar/DMScrollBar.swift b/DMScrollBar/DMScrollBar.swift index 92238cb..7b239ea 100644 --- a/DMScrollBar/DMScrollBar.swift +++ b/DMScrollBar/DMScrollBar.swift @@ -82,6 +82,7 @@ public class DMScrollBar: UIView { private func setupScrollView() { scrollView?.showsVerticalScrollIndicator = false + scrollView?.layoutIfNeeded() } private func setupScrollIndicator() {