Last active
December 17, 2020 03:39
-
-
Save KrauserHuang/6a3b15dbc57367e723a37b96c6950530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! PhotoCollectionViewCell | |
// let cell = collectionView.dequeueReusableCell(withReuseIdentifier: PropertyKeys.PhotoCollectionViewCell, for: indexPath) as! PhotoCollectionViewCell | |
// Configure the cell | |
//直接抓圖庫的圖片 | |
// cell.photoImageView.image = UIImage(named: "photo\(indexPath.item)") | |
//藉由變數photos利用indexPath判斷要顯示哪個item | |
cell.photoImageView.image = UIImage(named: "\(photos[indexPath.item])") | |
return cell | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment