Created
May 4, 2017 14:41
-
-
Save catqbat/cc67aea231ec36b04018e46f2ef9638d 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
//Asks your data source object for the number of items in the specified section. | |
//func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int | |
{ | |
return locations.count; | |
} | |
//Asks your data source object for the cell that corresponds to the specified item in the collection view. | |
//func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell | |
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell | |
{ | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "LocationCell", for: indexPath) as! LocationCell; | |
let location = locations[indexPath.row]; | |
cell.locationName = location.name; | |
return cell; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment