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細胞,但它也不會工作。如何迅速