CollectionView sizeForItemAtIndexPath never called

前端 未结 15 1445
一整个雨季
一整个雨季 2020-12-24 11:17

This is driving me crazy! I have a UICollectionViewController as shown below:

class PhrasesCompactCollectionViewController: UICollectionViewController
         


        
15条回答
  •  孤独总比滥情好
    2020-12-24 11:46

    I had this issue last night. Finally solved it at midnight when I realised 'didSelectItemAtIndex' method was not closed off with a closure bracket "}"

    I added a closure bracket at the very bottom of the class when asked by the compile error. So in effect all the methods below 'didSelectItemAtIndex' were inside that method.

    Posting here just in case anyone else wastes 4 hours of their evenings on this one :-(

提交回复
热议问题