D. Finna D. Finna - 8 months ago 50
iOS Question

Error when adding cell delegate to class - swift

Why do I get an error, when I add this code?:

, myProfileWorkoutTableViewCellDelegate

To my class?:

class myProfileTableViewController: UITableViewController, UICollectionViewDataSource, UICollectionViewDelegate, myProfileWorkoutTableViewCellDelegate {

This is the beginning of my

import UIKit
import Firebase
import FirebaseDatabase

protocol myProfileWorkoutTableViewCellDelegate {
func watchTrainingPressed(cell: myProfileWorkoutTableViewCell)

class myProfileWorkoutTableViewCell: UITableViewCell {

and this is my button inside the cell:

@IBAction func watchTrainingPressed(sender: AnyObject) {
if let _ = delegate {


You need to implement the function

func watchTrainingPressed(cell: myProfileWorkoutTableViewCell)

inside your myProfileTableViewController class.