//
|
// HomeMenuCell.swift
|
// OKProject
|
//
|
// Created by alvin_y on 2020/6/3.
|
// Copyright © 2020 yangwang. All rights reserved.
|
//
|
|
import UIKit
|
|
class HomeMenuCell: UICollectionViewCell {
|
|
/// 名称
|
var label_name = UILabel()
|
|
override init(frame: CGRect) {
|
super.init(frame: frame)
|
setupViews()
|
defineLayouts()
|
}
|
|
required init?(coder: NSCoder) {
|
fatalError("init(coder:) has not been implemented")
|
}
|
|
|
func configure(model: BusinessTypeModel){
|
label_name.text = model.name
|
label_name.textColor = model.select ? ThemeColor : UIColor.color(hexString: "#8C9097")
|
}
|
|
func setupViews() {
|
label_name.font = UIFont.init(name: Medium, size: 13)
|
label_name.textColor = UIColor.color(light: UIColor.color(hexString: "#8C9097"), dark: UIColor.color(hexString: "#8C9097"))
|
contentView.addSubview(label_name)
|
}
|
|
|
//MARK: - Layouts
|
func defineLayouts() {
|
label_name.snp.makeConstraints { (make) in
|
make.center.equalToSuperview()
|
}
|
}
|
}
|