Created
November 17, 2016 07:03
-
-
Save limabeans/d84536a135878efa6e30dd1cd2d453e8 to your computer and use it in GitHub Desktop.
embedded CV
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
import UIKit | |
class ViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource { | |
@IBOutlet weak var embeddedCV: UICollectionView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// make ourselves the delegate and data source of the CV. | |
embeddedCV.delegate = self | |
embeddedCV.dataSource = self | |
} | |
func numberOfSections(in collectionView: UICollectionView) -> Int { | |
return 1 | |
} | |
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | |
return 10 | |
} | |
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | |
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "CustomCVCell", for: indexPath) as! CustomCVCell | |
return cell | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment