AnalysisHeaderViewCell.swift 1.24 KB
//
//  AnalysisHeaderViewCell.swift
//  SwiftWarplyFramework
//
//  Created by Manos Chorianopoulos on 18/7/22.
//

import UIKit

class AnalysisHeaderViewCell: UITableViewCell {

    // attributes
    @IBOutlet weak var itemImage: UIImageView!
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var emptyLabel: UILabel!
    
    // lifecycle
    override func awakeFromNib() {
        super.awakeFromNib()
        
        // image
//        itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        
        // title
        titleLabel.textColor = UIColor(rgb: 0x435563)
        titleLabel.text = "Αναλυτικά:"
    }
}

extension AnalysisHeaderViewCell {
    func configureCell(isEmpty: Bool, isMarket: Bool) {
        
        if (isEmpty == true) {
            emptyLabel.isHidden = false
        } else {
            emptyLabel.isHidden = true
        }
        
        if (isMarket == true) {
            itemImage.image = UIImage(named: "ic_history_market", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        } else {
            itemImage.image = UIImage(named: "ic_gift_circle_2", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        }
        
    }
}