 //
 //  Created by 王龙辉 on 2017/8/13.
 //  Copyright © 2017年 onePieceDW. All rights reserved.
-//
+//  http://www.jianshu.com/p/fee4d10feefd
 
 import UIKit
-
+fileprivate let placeholder:String = "ic_bannerPlace"
 @objc protocol HHScrollViewDelegate:NSObjectProtocol {
     //点击代理方法
-  @objc optional func hhScrollView(_ scrollView: HHScrollView, didSelectRowAt index: NSInteger)
+    @objc optional func hhScrollView(_ scrollView: HHScrollView, didSelectRowAt index: NSInteger)
 }
 
 fileprivate let collectionViewCellId = "collectionViewCellId"

    
    //MARK: - UICollectionViewDataSource
    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        hhScrollViewDelegae?.hhScrollView!(self, didSelectRowAt: indexPath.row % imgUrls.count)
    }
    
    //MARK: - UIScrollViewDelegate

        //通过打印可以看到此时cell的frame就是我们在flowLayout中设置的结果
        print("self.collectionView:\(String(describing: self))")
        imageView = UIImageView.init(frame: self.bounds)
        imageView?.image = UIImage.init(named: placeholder)
        imageView?.contentMode = .scaleAspectFill
        contentView.addSubview(imageView!)
    }
