Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CustomCell: UICollectionViewCell, UITableViewDataSource, UITableViewDelegate {
- var tableView = UITableView()
- let cellIdentifier: String = "tableViewCell"
- override func layoutSubviews() {
- super.layoutSubviews()
- tableView.delegate = self
- tableView.dataSource = self
- tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier)
- }
- func numberOfSections(in tableView: UITableView) -> Int {
- return 1 // How many sections you want
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return 1 // How many rows per section you want
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle, reuseIdentifier: cellIdentifier)
- cell.textLabel?.text = "1 CUP"
- cell.detailTextLabel?.text = "Whole"
- return cell
- }
Advertisement
Add Comment
Please, Sign In to add comment