     
     func bringRefreshViewToSuperview() {
         guard let scrollView = scrollView, let superView = scrollView.superview else { return }
-        guard let scrollViewIndex = superView.subviews.index(of: scrollView) else { return }
         let frame = scrollView.convert(refreshView.frame, to: superView)
         refreshView.removeFromSuperview()
-        superView.insertSubview(refreshView, at: scrollViewIndex + 1)
+        superView.insertSubview(refreshView, aboveSubview: scrollView)
         refreshView.frame = frame
+        refreshView.layoutSubviews()
     }
     
     func sendRefreshViewToScrollView() {

                    scrollView?.contentInset = self.scrollViewDefaultInsets
                    state = .initial
                }
        
            default: break
            }
        }

        willSet {
            if #available(iOS 11.0, *) {
                scrollView?.removeAdjustedContentInsetsHandler(forPosition: position)
            }
            removeScrollViewObserving()
        }
        didSet {
