Don_Mag icon

Untitled

Don_Mag | PRO | 06/23/23 04:58:22 PM UTC | 0 ⭐ | 8291 👁️ | Never ⏰ | []
Swift |

1.11 KB

|

None

|

0 👍

/

0 👎

 
    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
        
    }
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎