Guest User

Untitled

a guest
Oct 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. class ViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
  2.  
  3. override func viewDidLoad() {
  4. super.viewDidLoad()
  5. // Do any additional setup after loading the view, typically from a nib.
  6. }
  7.  
  8. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  9. return 100
  10. }
  11.  
  12. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  13. return collectionView.dequeueReusableCell(withReuseIdentifier: "default", for: indexPath)
  14. }
  15. }
  16.  
  17. class CustomViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate {
  18. static let cellID = "default";
  19.  
  20. override func viewDidLoad() {
  21. super.viewDidLoad()
  22. // Do any additional setup after loading the view, typically from a nib.
  23. }
  24.  
  25. func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
  26. return 100
  27. }
  28.  
  29. func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  30. return collectionView.dequeueReusableCell(withReuseIdentifier: CustomViewController.cellID, for: indexPath)
  31. }
  32. }
Add Comment
Please, Sign In to add comment