BBSForumCell.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. //self.bbsSectionIconImageView.image = UIImage.sd_image(with: Data(base64Encoded: (bbsSectionData?.icon)!, options:NSData.Base64DecodingOptions.ignoreUnknownCharacters))
  16. let urlstr = AppDelegate.o2Collect.generateURLWithAppContextKey(BBSContext.bbsContextKey, query: BBSContext.bbsSectionIconQuery, parameter: ["##id##":bbsSectionData?.id as AnyObject], generateTime: false)
  17. let url = URL(string: urlstr!)
  18. self.bbsSectionIconImageView.hnk_setImageFromURL(url!)
  19. }
  20. }
  21. override func awakeFromNib() {
  22. self.bbsSectionIconImageView.layer.cornerRadius = 5
  23. self.bbsSectionIconImageView.layer.masksToBounds = true
  24. self.bbsSectionIconImageView.clipsToBounds = true
  25. }
  26. }