I'm using UICollectionView
in my swift class, it's placed on my UIViewController
. I connected the collectionView to the outlet in my code, I set up delegate
and datasource
and I see the outcome in my app. Everything works besides the fact that when I click each cell - nothing happens.
My code is as follows:
class UsersList: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
@IBOutlet weak var tview: UICollectionView!
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
tview.backgroundColor = UIColor.whiteColor() //this works
tview.delegate = self
tview.dataSource = self
}
func collectionView(tview: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print("You selected cell #\(indexPath.item)!")
//this does not appear in the console :(
}
Is there anything else I could do to see the print msg in the console?
override
word before thefunc collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath)
but then when I did that I got a message thatMethod does not override any method from its superclass
... Is there anything else I might miss? – Lambkin