 
 extension ArtScrollTab: UICollectionViewDelegate,UICollectionViewDataSource {
     
+    func registerCells() -> Void {
+        self.collectionView.register(ArtScrollTabCell.self, forCellWithReuseIdentifier: "ArtScrollTabCell")
+    }
+    
+    
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 8
+        return tabItems.count
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        return UICollectionViewCell()
-    }
+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ArtScrollTabCell", for: indexPath) as! ArtScrollTabCell
+        
+        if let item = (tabItems[indexPath.item]) as? ArtScrollTabItem {
+            cell.titleLabel.text = item.tabTitle
+        }
+        return cell
+    }
+    
+    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
+        if let item = (tabItems[indexPath.item]) as? ArtScrollTabItem {
+            return (item.tabFrame?.size)!;
+        }
+        
+        return CGSize.zero
+    }
+    
+
     
 }
 

    
    
    func constructScrollControls() -> Void {
        
    }
    
    func caculateTotalWidth() -> CGFloat {

}


class ArtScrollTabCell: UICollectionViewCell {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        buildUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func buildUI() -> Void {
        self.titleLabel.snp.makeConstraints { (make) in
            make.edges.equalTo(self.contentView)
        }
    }
    
    
   public lazy var titleLabel:UILabel = {
        let tempLabel = UILabel()
        
        tempLabel.font = UIFont.systemFont(ofSize: 17)
        tempLabel.textColor = UIColor.black
        
        return tempLabel
    }()
    
}






