         dataSource = self
         
         for view: UIView in view.subviews {
-            if (view is UIScrollView) {
-                (view as? UIScrollView)?.delegate = self
-                break
+            if let scrollView = view as? UIScrollView {
+                scrollView.delegate = self
             }
         }
         

    
    func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
        
        PageViewController.currentPage -= 1
        
        guard PageViewController.currentPage >= 0 else {
            PageViewController.currentPage = 0
            return nil
        }
        
        guard let viewControllerIndex = orderedViewControllers.index(of: viewController) else {
            return nil
        }
        

    
    func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
        
        guard let viewControllerIndex = orderedViewControllers.index(of: viewController) else {
            return nil
        }
        
        PageViewController.currentPage += 1
        
        if PageViewController.currentPage != viewControllerIndex {
            PageViewController.currentPage = viewControllerIndex
        }
        
        if PageViewController.currentPage > 2 {
            PageViewController.currentPage = 2
        }
        
        let nextIndex = viewControllerIndex + 1
