Files
flipper/iOS/Tutorial/Tutorial/ViewController.swift
Andres Suarez 79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00

32 lines
930 B
Swift

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import UIKit
class ViewController: UIViewController, UITableViewDataSource {
let marineMammals: [MarineMammal] = MarineMammal.defaultList
override func viewDidLoad() {
super.viewDidLoad()
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return marineMammals.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "MarineMammalCell", for: indexPath)
guard let mammalCell = cell as? MarineMammalCell else {
fatalError("Wrong cell identifier")
}
mammalCell.populate(marineMammal: marineMammals[indexPath.row])
return mammalCell
}
}