总结:记不住的代码10.20

64 20 44 49
10个单词     总结  感悟   看备忘录

 let nib = UINib.init(nibName: "FilmDetailHeaderView", bundle: nil)
        self.headerView = nib.instantiateWithOwner(self, options: nil).first as! FilmDetailHeaderView
        self.headerView.frame = CGRectMake(0, 0, 400, 350)
        self.headerView.playButton.addTarget(self, action: #selector(playAction), forControlEvents: .TouchDown)
        self.tableView.tableHeaderView = headerView


 //1.============header和简介============
                let base_info = dataDict["base_info"]
                //将字典转换成模型
                let baseInfoModel = FilmDetailHeaderModel.yy_modelWithJSON(base_info)
//存储模型
                self.headerModel = baseInfoModel
                //刷新headerView上的显示
                self.headerView.model = self.headerModel


class FilmDetailHeaderModel: NSObject,YYModel {
    
    var actors = ""
    var country = ""
    var desc = ""
    var directors = ""
    var film_id = ""
    var genre = ""
    var name = ""
    var poster_url = ""
    var release_time = ""
    var score = ""
    var videos:FilmDetailVideosModel? = nil
    
    //调试
    override var description: String{
        
        return name
    }
    
}

class FilmDetailVideosModel: NSObject,YYModel {
    
    var list:NSArray? = nil
    
    //容器映射
    static func modelContainerPropertyGenericClass() -> [NSObject : AnyObject]! {
        
        return ["list":VideoModel.self]
    }
    
}
class VideoModel: NSObject,YYModel {
    
    var durtion = ""
    var image_url = ""
    var play_url = ""
    var title = ""
    var video_url = ""
}

你可能感兴趣的:(总结:记不住的代码10.20)