         v.isDoubleSided = false
         
         for view in v.view.subviews {
-            if view.isKind(of: UIScrollView.self) {
-                (view as? UIScrollView)?.delegate = self
+            if let v = view as? UIScrollView {
+                v.delegate = self
             }
         }
     }

            return
        }
        
        setViewControllers([viewControllers[index]], direction: index < selectedIndex ? .reverse : .forward, animated: true) { [weak self, index = index] _ in
            guard let s = self else {
                return
            }
            s.selectedIndex = index
            s.pageTabBar.select(at: index)
        }
    }
    

        }
        
        let next = current + 1
        
        guard viewControllers.count > next else {
            return nil
        }
        
