Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. let sections = ["Apples", "Oranges"]
  2.  
  3. override func numberOfSections(in tableView: UITableView) -> Int {
  4. return sections.count
  5. }
  6.  
  7.  
  8.  
  9. override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  10.  
  11.  
  12. //Option A)
  13. if apples.count & oranges.count != 0 {
  14. return apples.count & oranges.count
  15. } else {
  16. return 0
  17. }
  18.  
  19. //Option B)
  20.  
  21. if sections[0] == "Apples" {
  22. return apples.count
  23. }
  24.  
  25. if sections[1] == "Oranges"{
  26. return oranges.count
  27. }
  28. return 0
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement