 	
 	func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
 		let cell = collectionView.dequeueReusableCellWithReuseIdentifier(SliderCell.identifier, forIndexPath: indexPath) as! SliderCell
+		cell.backgroundColor = UIColor.blackColor()
 		
 		return cell
 	}
+	
 }



class ScientificSliderViewController2: UIViewController, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource {
	override func loadView() {
		super.loadView()
		view.backgroundColor = UIColor.lightGrayColor()
		view.addSubview(collectionView)
	}
	
	override func viewWillLayoutSubviews() {

		collectionView.frame = frame
	}
	
	override func viewWillAppear(animated: Bool) {
		super.viewWillAppear(animated)
		view.addGestureRecognizer(pinchGestureRecognizer)
	}

	override func viewDidDisappear(animated: Bool) {
		super.viewDidDisappear(animated)
		view.removeGestureRecognizer(pinchGestureRecognizer)
	}
	
	lazy var layout: FlowLayout = {
		return self.createFlowLayout()
	}()
	
	func computeItemSize() -> CGSize {
		let w = 30 * scale
		return CGSize(width: w, height: w)
	}
	
	func createFlowLayout() -> FlowLayout {
		let instance = FlowLayout()
		instance.scrollDirection = .Horizontal
		instance.minimumInteritemSpacing = 1
		instance.minimumLineSpacing = 1
//		instance.itemSize = computeItemSize()
		return instance
	}
	
	lazy var collectionView: UICollectionView = {
		let instance = UICollectionView(frame: CGRectZero, collectionViewLayout: self.layout)
//		instance.showsHorizontalScrollIndicator = false
		instance.backgroundColor = UIColor.whiteColor()
		instance.delegate = self
		instance.dataSource = self
//		instance.bounces = false
//		instance.allowsSelection = false
		instance.registerClass(SliderCell.self, forCellWithReuseIdentifier: SliderCell.identifier)
		
//		instance.minimumZoomScale = 1.0
//		instance.maximumZoomScale = 2.0
//		instance.zoomScale = 1.5
		return instance
	}()
	
	func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
		return computeItemSize()
	}
	
//	func collectionView_setup() {
//		collectionView.delegate = self
//		collectionView.dataSource = self
//	}
	
//	func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
//		return collectionView
//	}
	

	func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
