BBSForumCell.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // BBSForumCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2016/11/3.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class BBSForumCell: UICollectionViewCell {
  10. @IBOutlet weak var bbsSectionTitleLabel: UILabel!
  11. @IBOutlet weak var bbsSectionIconImageView: UIImageView!
  12. var bbsSectionData:BBSectionListData? {
  13. didSet {
  14. self.bbsSectionTitleLabel.text = bbsSectionData?.sectionName
  15. if bbsSectionData?.icon != nil {
  16. self.bbsSectionIconImageView.image = UIImage.sd_image(with: Data(base64Encoded: (bbsSectionData?.icon)!, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters))
  17. }else {
  18. self.bbsSectionIconImageView.image = UIImage(named: "icon_forum_default")
  19. }
  20. // let urlstr = AppDelegate.o2Collect.generateURLWithAppContextKey(BBSContext.bbsContextKey, query: BBSContext.bbsSectionIconQuery, parameter: ["##id##":bbsSectionData?.id as AnyObject], generateTime: false)
  21. // let url = URL(string: urlstr!)
  22. // self.bbsSectionIconImageView.hnk_setImageFromURL(url!)
  23. }
  24. }
  25. override func awakeFromNib() {
  26. self.bbsSectionIconImageView.layer.cornerRadius = 5
  27. self.bbsSectionIconImageView.layer.masksToBounds = true
  28. self.bbsSectionIconImageView.clipsToBounds = true
  29. }
  30. }