I'm trying to pass data from a UITableView when clicking on the cell. This is what I've written from a similar flow that worked, thinking it would work as well but it doesn't pass any data.
Here is the code:
extension PastBoxesViewController: UITableViewDelegate {
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let nextVC = GiftViewController()
nextVC.title = "Gift Number (indexPath.row)"
self.navigationController?.pushViewController(nextVC, animated: true)
}
}
class GiftViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title = ""
self.view.backgroundColor = #colorLiteral(red: 0.8186396956, green: 0.7955000997, blue: 1, alpha: 1)
}
}
This method of passing data works outside a UITable, does it not work inside or am I missing something?
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…