//
//  AV_selectWeightCell.swift
//  anniversary_Project
//
//  Created by 忆海16 on 2024/7/9.
//

import UIKit

class AV_selectWeightCell: UITableViewCell,weightViewDelegate {

    @IBOutlet weak var ageView: AgePickerView!
    
    @IBOutlet weak var weightView: UIView!
    
    
    var rulerV = weightRulerView()
    
//    private let agePickerView = AgePickerView()
     
     var onAgeSelected: ((Int) -> Void)? {
         didSet {
             ageView.onAgeSelected = onAgeSelected
         }
     }
//    var onweightSelected: ((Int) -> Void)? {
//        didSet {
//            rulerV.onweightSelected = onweightSelected
//        }
//        
//    }
    override func awakeFromNib() {
        super.awakeFromNib()
        rulerV.delegate = self
        rulerV = weightRulerView(frame:CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 50))
        print("----\(rulerV.valueLabel.text ?? "")")
        self.weightView.addSubview(rulerV)
        ageView.translatesAutoresizingMaskIntoConstraints = false
    }
    
    
    func sliderRulerView(ruler: weightRulerView, rulervalue: CGFloat) {
         // Handle the ruler value here
         print("Selected value: \(rulervalue) kg")
     }
//    override func prepareForReuse() {
//           super.prepareForReuse()
//        rulerV.delegate = self
//       }
    
}

