     */
 
 }
+
+extension CycleScrollView :UICollectionViewDelegate,UICollectionViewDataSource
+{
+    
+    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        print(images.count)
+        
+        return 5
+    }
+    
+    func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
+        
+      let cell = collectionView.dequeueReusableCellWithReuseIdentifier("1111", forIndexPath: indexPath)
+        
+        if indexPath.item % 2 == 0 {
+            cell.backgroundColor = UIColor.blueColor()
+        }else
+        {
+            cell.backgroundColor = UIColor.redColor()
+        
+        }
+        
+        
+        
+        
+            return cell
+    }
+    
+       
+  
+
+
+}
+
+class CycleViewLayout: UICollectionViewFlowLayout
+{
+    override func prepareLayout() {
+        super.prepareLayout()
+    }
+    
+    
+    
+
+
+}
+
+

    
    private func makeUI()
    {
        backgroundColor = UIColor.redColor()
    
    }
    
    


class CycleScrollView: UIView {
    
    var imagesURL = []{
        didSet{
            collectionView?.reloadData()
            print(imagesURL)
        
        }
    
    }
    let images = []
    
    var placeholder:UIImage?{
        didSet{
        
        
        }
    }
    
    
    // 自己的属性
    private var collectionView:UICollectionView?
    private var layout:CycleViewLayout!
    
    convenience init(placeholder: UIImage,imagesURL:[String]) {
        let size = placeholder.size
        self.init(frame: CGRect(origin: CGPointZero, size: size))
        self.imagesURL = imagesURL
        
        
    }

