     fileprivate var rightView:UIView?
     fileprivate var leftView:UIView?
     fileprivate var collectionview:UICollectionView?
+    fileprivate var barscrollView:UIScrollView?
+    fileprivate var bottomLineView:UIView?
     
     // porperty
     fileprivate var selectIndex:Int = Int.max

                collectionView.setContentOffset(CGPoint(x: collectionView.contentSize.width - collectionView.frame.size.width , y: 0), animated: true)
            }
            
            
        }
        selectIndex = indexPath.row

        collectionview?.register(YHTabBarViewItem.self, forCellWithReuseIdentifier: "YHTabBarItem")

    }
    // MARK: loading ScrollView
    fileprivate func YHTabBarViewScrollView(){
        
        var leftsize:CGFloat = 0
        if let leftView = leftView{
            leftsize = leftView.frame.size.width
        }
        var rightsize:CGFloat = 0
        if let rightView = rightView{
            rightsize = rightView.frame.size.width
        }
        
        barscrollView = UIScrollView(frame: CGRect(x: leftsize, y: 0, width: self.frame.size.width - leftsize - rightsize, height: self.frame.size.height))
        barscrollView?.backgroundColor = UIColor.cyan
        self.addSubview(barscrollView!)
    }
    // MARK: loading BottomLineView
    fileprivate func YHTabBarBottomLineView(){
        bottomLineView = UIView(frame: CGRect(x: 0, y: self.frame.size.height - lineBottomHeight, width: 0, height: lineBottomHeight))
        bottomLineView?.backgroundColor = ItemSelectedColor
        barscrollView?.addSubview(bottomLineView!)
        barscrollView?.contentSize = (collectionview?.contentSize)!
    }
}

// MARK: UICollectionView delegate datasource layoutDelegate
