卡片布局,支持水平、垂直滚动。OC版本请点击这里
let layout = CardLayout()
let collectionView = UICollectionView(frame: view.bounds, collectionViewLayout: layout)
//cell的尺寸
var itemSize: CGSize
//cell间距
var spacing: CGFloat
//缩放率
var scale: CGFloat
//边距
var edgeInset: UIEdgeInsets
//滚动方向
var scrollDirection: UICollectionViewScrollDirection