Я пробовал так много вещей, но безрезультатно, может ли кто-нибудь мне с этим помочь
Код: Выделить всё
import UIKit
class SeventhLoanCVCell: UICollectionViewCell {
@IBOutlet weak var imgStatus: UIImageView!
@IBOutlet weak var imgProgress: UIImageView!
@IBOutlet weak var viewProgress: UIView!
@IBOutlet weak var lblNumber: UILabel!
@IBOutlet weak var imgProgressWidthCon: NSLayoutConstraint!
override func awakeFromNib() {
super.awakeFromNib()
imgProgressWidthCon.constant = 28.adjustedHeight
lblNumber.font = .appFont(.switzerSemibold, size: CGFloat(14))
}
func configureCell(for step: ProgressStep) {
lblNumber.text = "\(step.pcNumber ?? 0)"
lblNumber.textColor = .textColorv2
switch step.pcColor {
case "fullbluegreen":
imgProgress.image = UIImage(named: "fullBlue")
imgStatus.image = UIImage(named: "greenTickP")
viewProgress.backgroundColor = .proBlueClr
lblNumber.textColor = .white
case "fullbluered":
imgProgress.image = UIImage(named: "fullBlue")
imgStatus.image = UIImage(named: "crossRedP")
viewProgress.backgroundColor = .proGrayClr
lblNumber.textColor = .white
case "halfblue":
imgProgress.image = UIImage(named: "halfBlue")
imgStatus.image = UIImage(named: "grayTickP")
viewProgress.backgroundColor = .proGrayClr
case "gray":
imgProgress.image = UIImage(named: "garyProgress")
imgStatus.image = UIImage(named: "grayTickP")
viewProgress.backgroundColor = .proGrayClr
case "yellow":
imgProgress.image = UIImage(named: "yellowPr")
imgStatus.image = UIImage(named: "yellowGift")
viewProgress.backgroundColor = .proGrayClr
case "blur":
imgProgress.image = UIImage(named: "garyProgress")
imgStatus.image = UIImage(named: "grayTickP")
viewProgress.backgroundColor = .proGrayClr
lblNumber.textColor = .proBlueTxtClr
default:
imgProgress.image = UIImage(named: "garyProgress")
imgStatus.image = UIImage(named: "grayTickP")
viewProgress.backgroundColor = .proGrayClr
}
}
}
UI Streak
Подробнее здесь: https://stackoverflow.com/questions/798 ... -view-item
Мобильная версия