Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // SingleHotelTableViewController.swift
- // CleverPumpkinTest
- //
- // Created by Константин Фомин on 13.07.2018.
- // Copyright © 2018 Константин. All rights reserved.
- //
- import UIKit
- class SingleHotelTableViewController: UITableViewController {
- var id : Int?
- override func viewDidLoad() {
- super.viewDidLoad()
- tableView.separatorStyle = .none
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- }
- override func numberOfSections(in tableView: UITableView) -> Int {
- return 1
- }
- override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return 1
- }
- override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "singleHotelCell", for: indexPath) as! SingleHotelTableViewCell
- cell.initializing(idOfHotel: id!)
- return cell
- }
- override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
- if let destinationHotelViewController = segue.destination as? HotelOnMapViewController {
- let indexPath = IndexPath(row: 0, section: 0)
- let cell = tableView.cellForRow(at: indexPath) as! SingleHotelTableViewCell
- destinationHotelViewController.hotel = cell.hotel
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment