     
     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() {

    }
    
}

                if case .top = self.position {
                    self.scrollView?.contentOffset.y = -self.defaultInsets.top
                }
        },
            completion: { _ in
                self.addScrollViewObserving()
                self.state = .initial
        }
        )
    }
}
