     fileprivate var currentAnimatedTransitioningType: SwipeTransitioningProtocol = SwipeAnimation()
 
     private let kSelectedViewControllerKey = "selectedViewController"
+    private let kSelectedIndexKey = "selectedIndex"
 
     required public init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)


        // Observe selected index changes to wire the gesture recognizer to the viewController.
        addObserver(self, forKeyPath: kSelectedViewControllerKey, options: .new, context: nil)
    }

    /// Checks if a transition is being performed.

    override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {

        // .selectedViewController changes so we setup the swipe interactor to the new selected Controller.
        if keyPath == kSelectedViewControllerKey || keyPath == kSelectedIndexKey {
            if let selectedController = selectedViewController {
                swipeInteractor.wireTo(viewController: selectedController.firstController())
            }
