AppCategoryHeaderView.swift 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // AppCategoryHeaderView.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/7/28.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import SDWebImage
  10. class AppCategoryHeaderView: UICollectionReusableView {
  11. @IBOutlet weak var appIconImageView: UIImageView!
  12. @IBOutlet weak var appTitleLabel: UILabel!
  13. var app:Application? {
  14. didSet {
  15. self.appTitleLabel.text = app?.name
  16. if let icon = app?.icon {
  17. self.appIconImageView.image = UIImage.sd_image(with: Data(base64Encoded:icon, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters))
  18. }else{
  19. self.appIconImageView.image = UIImage(named: "apps_selected")
  20. }
  21. }
  22. }
  23. override func awakeFromNib() {
  24. self.appTitleLabel.textColor = UIColor.white
  25. }
  26. }