Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! LessonsVCCell
- // set cellTitle label text
- cell.cellTitle.text = lessonsArray[indexPath.row].name
- // set cellDescription label text
- cell.cellDescription.text = lessonsArray[indexPath.row].details
- if lessonsArray[indexPath.row].blocked == 1 {
- // show cellImg view - does it get hidden somewhere ???
- cell.cellImg.isHidden = false
- // show cellBtn button
- cell.cellBtn.isHidden = false
- //set cellImg image
- cell.cellImg.image = UIImage(systemName:"lock.fill")
- // create a new UIImageView, set its "color" -- but then do nothing with it ????
- let cellImg = UIImageView(image: UIImage(named: "your_image_name"))
- cellImg.setImageColor(color: UIColor.systemOrange)
- } else {
- // hide cellBtn button
- cell.cellBtn.isHidden = true
- //set cellImg image
- cell.cellImg.image = UIImage(named:"RightAnswerNew")
- }
- return cell
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement