Reputation: 67
This is probably a newbie mistake and question but what's wrong with this code below?
class CustomCell: UITableViewCell {
@IBOutlet weak var TitleLabel: UILabel!
@IBOutlet weak var ImageView: UIImageView!
@IBOutlet weak var NumbersView: UILabel!
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 customInit(text: String, numbersText: String, photo: UIImage) {
self.TitleLabel.text = text
self.NumbersView.text = text
self.ImageView.photo = UIImage)
}
}
I'm following a tutorial called " SegmentedControl - Switch 'Custom' TableViews: Swift 3" and the user used the following code: func customInit(text: String, accessoryText: String but I changed it to include an UIImage but I don't know if thats correct or needed.
Upvotes: 1
Views: 40
Reputation: 1368
It should be like this:
self.ImageView.image = photo
self.NumbersView.text = numbersText
Upvotes: 2