Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import Foundation
  2. import UIKit
  3.  
  4. class HolidaysViewController: UITableViewController {
  5. var model: [Holiday]?
  6. override func viewDidLoad() {
  7. super.viewDidLoad()
  8. }
  9. // MARK: - Table view data source
  10.  
  11. override func numberOfSections(in tableView: UITableView) -> Int {
  12. // #warning Incomplete implementation, return the number of sections
  13. return 1
  14. }
  15.  
  16. override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  17. // #warning Incomplete implementation, return the number of rows
  18. guard let _ = self.model else {
  19. return 0
  20. }
  21. return self.model!.count
  22. }
  23.  
  24. override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  25. // Create an object of the dynamic cell "PlainCell"
  26. let cell = tableView.dequeueReusableCell(withIdentifier: "holidaysid", for: indexPath)
  27. // Holiday selection
  28. let holiday = self.model![indexPath.row]
  29. cell.makeCustomText(model: holiday)
  30. // Return the configured cell
  31. return cell
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement