2
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as UICollectionViewCell
var template: UIView
template = UIView.init(frame: CGRectMake(10, 10, 50, 50))
template.backgroundColor = UIColor.redColor()
self.cell.addSubview(template)
return cell
}
在UICollectionView细胞添加的UIView编程我试图拖动的UIView插入故事板和addSubview到出口的CollectionView细胞,但它也不会工作。如何迅速