Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let sections = ["Apples", "Oranges"]
- override func numberOfSections(in tableView: UITableView) -> Int {
- return sections.count
- }
- override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- //Option A)
- if apples.count & oranges.count != 0 {
- return apples.count & oranges.count
- } else {
- return 0
- }
- //Option B)
- if sections[0] == "Apples" {
- return apples.count
- }
- if sections[1] == "Oranges"{
- return oranges.count
- }
- return 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement