         let oldViewController = viewControllers[previousPageIndex]
         let newViewController = viewControllers[selectedPageIndex]
         
-        if automaticallyHandleAppearanceTransitions {
+        if self.automaticallyHandleAppearanceTransitions {
             oldViewController.beginAppearanceTransition(false, animated: true)
             newViewController.beginAppearanceTransition(true, animated: true)
         }

//
//

import Foundation

/// PagerViewControllerDelegate
@objc public protocol DTPagerControllerDelegate: NSObjectProtocol {

            self.setNeedsStatusBarAppearanceUpdate()
            
        }, completion: { (finished) -> Void in
            
            //Call delegate method after changing value
            self.delegate?.pagerController?(self, didChangeSelectedPageIndex: self.selectedPageIndex)
        })
        
        // Call these two methods to notify that two view controllers are already removed or added to container view controller (Check Documentation)
        if automaticallyHandleAppearanceTransitions {
            oldViewController.removeFromParent()
            newViewController.didMove(toParent: self)
            
            oldViewController.endAppearanceTransition()
            newViewController.endAppearanceTransition()
        }
        
        // Setting up new previousPageIndex for next change
        previousPageIndex =  selectedPageIndex
    }
    
    // Remove all current child view controllers
