             guard panGestureRecognizer != nil else {
                 return
             }
-            panGestureRecognizer.maximumNumberOfTouches = maximumNumberOfTouches
+            panGestureRecognizer?.maximumNumberOfTouches = maximumNumberOfTouches
         }
     }
     

    }
}

// MARK: - UITabBarControllerDelegate
extension SwipeableTabBarController: UITabBarControllerDelegate {


        // UITabBarControllerDelegate for transitions.
        delegate = self
        // Gesture setup
        let panGesture = UIPanGestureRecognizer(target: self, action: #selector(panGestureRecognizerDidPan(_:)))
        panGesture.delegate = self
        view.addGestureRecognizer(panGesture)
        panGestureRecognizer = panGesture
    }

    @IBAction func panGestureRecognizerDidPan(_ sender: UIPanGestureRecognizer) {
