I have been using the UICollectionviewController. So , we try to make a transition to another screen by pressing the cell . But , the text that has been put in a cell will want to disappear when you press the cell . Could you tell me the reason for this ?
・ViewController
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell:CustomCell = collectionView.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! CustomCell
cell.category.text = " BBBBBB ";
cell.category.backgroundColor = UIColor.blueColor();
cell.date.text = "2016-03-26";
cell.title.text = "AAAAAAAAAAAA";
cell.imgSample.image = UIImage(named: "CCCCC.png")
cell.backgroundColor = UIColor.whiteColor()
/
cell.layer.masksToBounds = false;
cell.layer.shadowOffset = CGSizeMake(0.0, 0.3);
cell.layer.shadowOpacity = 0.2;
cell.layer.shadowRadius = 0.5;
return cell
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
let width: CGFloat = self.view.frame.width / 2 - 17.5
let height: CGFloat = 220
return CGSize(width: width, height: height)
}
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 50;
}