//

// CardsViewController.swift

// Pokecard

//

// Created by Alex on 7/15/22.

//

import UIKit

class CardsViewController: UIViewController {

override func viewDidLoad() {

super.viewDidLoad()

setUpTableView()

// Do any additional setup after loading the view, typically from a nib.

}

@IBOutlet weak var tableView: UITableView!

func setUpTableView() {

tableView.delegate = self

tableView.dataSource = self

tableView.register(UINib(nibName: "CardTableViewCell", bundle: nil), forCellReuseIdentifier: "cardCell")

tableView.rowHeight = 120

tableView.backgroundColor = .white

}

}

extension CardsViewController : UITableViewDelegate, UITableViewDataSource {

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

return 120

}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

let cell = tableView.dequeueReusableCell(withIdentifier: "cardCell", for: indexPath) as! CardTableViewCell

return cell

}

}

Reply to this note

Please Login to reply.

Discussion

No replies yet.