// // EverybodyLoveView.swift // ADHTuanCan // // Created by 敖德亨 on 2023/9/29. // import UIKit class EverybodyLoveView: UIView { /// titleScrollView @IBOutlet weak var titleScrollView: UIScrollView! /// 餐品ScrollView @IBOutlet weak var scroBackView: UIView! @IBOutlet weak var scrollBackHeight: NSLayoutConstraint! var interspace : CGFloat = 10 let itemWeight : CGFloat = (kSCREEN_WIDTH - 30)/2 ///早中晚typemodel var dataModel : SupplyTypeListModel? ///所有人都爱Foods var dataSource : [HomeFoodDetailModel]? var allBtns : [UIButton] = [] var supplyTypeAction : ((String?)->Void)? var touchUpActionBlock : ((Int)->Void)? override func awakeFromNib() { super.awakeFromNib() self.backgroundColor = kTBackgroundColor self.titleScrollView.alwaysBounceHorizontal = true self.titleScrollView.isScrollEnabled = true self.titleScrollView.showsHorizontalScrollIndicator = false self.titleScrollView.contentInsetAdjustmentBehavior = .never self.scrollBackHeight.constant = 340 self.scroBackView.addSubview(self.scrollView) self.scrollView.mas_remakeConstraints { make in make?.left.right().mas_equalTo()(self.scroBackView) make?.bottom.mas_equalTo()(self.scroBackView.mas_bottom)?.offset() make?.height.offset()(268) } } func configTitle(model : SupplyTypeListModel){ dataModel = model self.lineView.isHidden = true for view in titleScrollView.subviews { view.removeFromSuperview() } self.allBtns.removeAll() self.titleScrollView.addSubview(self.lineView) if let _ = model.supplyTypeList{ for i in 0..