Music_Player3/MusicPlayer/MP/Views/Home(音乐资源列表-播放器)/Home_FourthListCollectionViewCell.swift
Mr.zhou 96147c5e37 项目:Musicoo
版本:A面 1.0
构建:1.1
更新内容:对项目A面功能的实现,经测试确定各项功能无问题。
更新时间:2024年4月12日 11:20
上传状态:已上传App Connect
2024-04-12 11:19:58 +08:00

42 lines
1.5 KiB
Swift

//
// Home_FourthListCollectionViewCell.swift
// MusicPlayer
//
// Created by Mr.Zhou on 2024/3/27.
//
import UIKit
///Cell
class Home_FourthListCollectionViewCell: UICollectionViewCell {
@IBOutlet weak var coverImageView: UIImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var subtitleLabel: UILabel!
@IBOutlet weak var shieldView: UIView!
@IBOutlet weak var stateBtn: UIButton!
var musicView:MusicViewModel!{
didSet{
coverImageView.image = musicView.cover
titleLabel.text = musicView.title
subtitleLabel.text = musicView.duration
//,
guard MPMediaCenterManager.shared.getPlayerState() == .Playing, MPMediaCenterManager.shared.getMusic()?.identifier == musicView.music.identifier else {
//
titleLabel.textColor = .init(hex: "#FFFFFF")
subtitleLabel.textColor = .init(hex: "#FFFFFF")
stateBtn.isSelected = false
shieldView.isHidden = true
return
}
//
titleLabel.textColor = .init(hex: "#80F988")
subtitleLabel.textColor = .init(hex: "#80F988")
stateBtn.isSelected = true
shieldView.isHidden = false
}
}
override func awakeFromNib() {
super.awakeFromNib()
}
}