         layout.itemSize = frame.size
         
         super.init(frame: frame, collectionViewLayout: layout)
-
+        
         self.delegate = self
         self.dataSource = self
         self.pagingEnabled = true

        let indexPath = NSIndexPath(forRow: index, inSection: 0)
        self.reloadItemsAtIndexPaths([indexPath])
    }

    public func moveToIndex(index:Int) {
        let offset = CGPointMake(self.frame.size.width * CGFloat(index), 0)
        self.setContentOffset(offset, animated: true)

    
    public func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
        self.pagingDelegate?.pagingView(self, willMoveToPageAtIndex: indexPath.row)
        
        if indexPath.row == 0 && self.isDisplay == false {
            self.isDisplay = true
            self.pagingDelegate?.pagingView(self, didMoveToPageAtIndex: indexPath.row)
        }
    }
    
    // MARK: pagingView layout delegate
