 
 open class TabMenuController: UIViewController {
     @IBInspectable
-    open var selectedIndex: Int {
-        didSet {
-            scrollView.setContentOffset(CGPoint(x: scrollView.width * CGFloat(selectedIndex), y: 0), animated: true)
-            
-            guard false == tabBar?.isAnimating else {
-                return
-            }
-            
-            tabBar?.select(at: selectedIndex)
-        }
-    }
+    open var selectedIndex = 0
     
     /// Enables and disables bouncing when swiping.
     open var isBounceEnabled: Bool {

            return
        }
        
        if 1 < abs(index - selectedIndex) {
            let last = viewControllers.count - 1
            var pos = 0
            
            if last == selectedIndex {
                pos = last - 1
            } else if 0 == selectedIndex {
                pos = 1
            } else {
                pos = selectedIndex + (index > selectedIndex ? 1 : -1)
            }
            
            scrollView.setContentOffset(CGPoint(x: scrollView.width * CGFloat(pos), y: 0), animated: false)
        }
        
        selectedIndex = index
        prepareViewControllers()
        layoutViewControllers()
    }

            }
        } else if viewControllers.count - 1 == selectedIndex {
            for i in 0..<count {
                layoutViewController(at: selectedIndex - i, position: count - i - 1)
            }
        } else {
            layoutViewController(at: selectedIndex, position: 1)
            layoutViewController(at: selectedIndex - 1, position: 0)
            layoutViewController(at: selectedIndex + 1, position: 2)
            scrollView.setContentOffset(CGPoint(x: scrollView.width, y: 0), animated: false)
        }
    }
    
