//
//  MPPositive_CollectionArtistViewModel.swift
//  MusicPlayer
//
//  Created by Mr.Zhou on 2024/5/28.
//

import UIKit
import Kingfisher
///收藏艺术家实体
class MPPositive_CollectionArtistViewModel: NSObject {
    ///封面
    var coverURL:URL!
    ///标题
    var title:String?
    ///副标题
    var subtitle:String?
    ///收藏列表实体
    var collectionArtist:MPPositive_CollectionArtistModel
    
    init(_ artist:MPPositive_CollectionArtistModel) {
        collectionArtist = artist
        super.init()
        configure()
    }
    //配置数据
    private func configure() {
        if collectionArtist.coverImage != nil {
            coverURL = collectionArtist.coverImage
        }
        title = collectionArtist.title
        subtitle = collectionArtist.subtitle
    }
    //设置预览图
    func setImage(_ imageView:UIImageView) {
        if coverURL != nil {
            imageView.kf.setImage(with: coverURL, placeholder: placeholderImage)
        }
    }
}
