2 // BookDetailsHeaderTableViewCell.swift
5 // Created by Pawel Dabrowski on 19/06/2018.
6 // Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
12 class BookDetailsHeaderTableViewCell: WLTableViewCell {
14 @IBOutlet weak var titleLabel: UILabel!
15 @IBOutlet weak var bgImageView: UIImageView!
16 @IBOutlet weak var bgOverlayView: UIView!
17 @IBOutlet weak var miniatureImageView: UIImageView!
21 class func instance(height: CGFloat) -> BookDetailsHeaderTableViewCell{
22 let cell = BookDetailsHeaderTableViewCell.instance(type: BookDetailsHeaderTableViewCell.self)
27 override func awakeFromNib() {
29 bgOverlayView.alpha = 0.7
32 func setup(bookModel: BookDetailsModel, topColor: UIColor){
34 bgOverlayView.backgroundColor = topColor
35 let titleAttributedText = bookModel.getAttributedAuthorAndTitle(titleFont: UIFont.systemFont(ofSize: 22, weight: .light), descFont: UIFont.systemFont(ofSize: 28, weight: .light))
36 titleLabel.attributedText = titleAttributedText
38 if let url = bookModel.getCoverThumbUrl(){
39 ImageDownloader.default.downloadImage(with: url, options: [], progressBlock: nil) {
40 [weak self] (image, error, url, data) in
42 self?.bgImageView.image = image
43 self?.miniatureImageView.image = image
49 override func getHeight() -> CGFloat {