I have a custom TableViewCell
. Inside of this, I want to put another TableView
, but I'm having problems.
I have something like this:
import UIKit
class ByteCell: UITableViewCell, UITableViewDelegate, UITableViewDataSource {
@IBOutlet weak var title: UILabel!
@IBOutlet weak var game: UIImageView!
@IBOutlet weak var TableView: UIView!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 5
}
}
First of all, I can't write:
tableView.delegate = self
tableView.dataSource = self
anywhere in here, so I can't modify the tableView at all.
Secondly, the TableView
that does appear, doesn't have any rows, and can't be scrolled. I essentially want to make a scrollable TableView
inside of a custom cell which is inside of a TableView
.
Is this possible?
Thanks!