//
//  VipTagView.swift
//  ColorfulWallpaper
//
//  Created by nkl on 2024/9/10.
//

import Foundation
import UIKit

class VipTagView: UIView {
    lazy var bgImageView : UIImageView = .simpleImage(imageName: "icon_wallpaper_reward")
    lazy var topImageView : UIImageView = UIImageView.init(image: UIImage.init(named: "icon_ad_font_big"))
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        addSubview(bgImageView)
        addSubview(topImageView)
        bgImageView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        topImageView.snp.makeConstraints { make in
            make.center.equalToSuperview()
        }
    }
    
    func set(image: UIImage?,top:UIImage?) {
        if let image = image {
            bgImageView.setLocalizedImage(image)
        }
        if let topImage = top {
            topImageView.image = topImage
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
