นี่มันทำให้ฉันแทบคลั่ง! ฉันมี UICollectionViewController ดังที่แสดงด้านล่าง:
class PhrasesCompactCollectionViewController: UICollectionViewController
numberOfSections และ cellForItemAt ถูกเรียก แต่ sizeForItemAtIndexPath จะไม่ถูกเรียก ฉันใช้รหัสเดียวกันกับที่อื่นและทำงานอย่างถูกต้อง ฉันใช้ Xcode 8 Beta 6
func collectionView(collectionView: UICollectionView,
layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSize(width: 120, height:120)
}