//
//  SpeakSnowNumViewCtr.swift
//  SpeakEasyLearnEnglish
//
//  Created by edy on 2025/8/1.
//

import UIKit

class SpeakSnowNumViewCtr: UIViewController {

    @IBOutlet var SpeakSnowNumIcons: [UIImageView]!
    @IBOutlet weak var SpeakBottomConst: NSLayoutConstraint!
    
    var signSnowNum:Int{
        set{}
        get{
            return SpeakElePublicManager.share.userInfo.snowNum ?? 0
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        SpeakBottomConst.constant = -Dev.screenH
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        for (i,icon) in SpeakSnowNumIcons.enumerated() {
            if i < signSnowNum {
                icon.image = UIImage(named: "icon_snow_on")
            }else{
                icon.image = UIImage(named: "icon_snow_off")
            }
        }
        self.view.setNeedsDisplay()
        DispatchQueue.main.async {
            UIView.animate(withDuration: 0.25) {
                self.SpeakBottomConst.constant = 0
                self.view.layoutIfNeeded()
            }
        }
    }
    
    @IBAction func SpeakSnowNumSureTaps(_ sender: Any) {
        self.dismiss(animated: true)
    }
    
    @IBAction func SpeakSnowNumInfoTaps(_ sender: Any) {
        
    }
}
