MainAppActionCell.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // MainAppActionCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/7/27.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. protocol MainAppActionCellDelegate {
  10. func clickWithApp(_ app:O2App)
  11. }
  12. class MainAppActionCell: UITableViewCell{
  13. @IBOutlet weak var appCollectionView: UICollectionView!
  14. fileprivate let collectionViewDelegate = ZLCollectionView()
  15. var delegate:MainAppActionCellDelegate?
  16. var cellHeight:CGFloat {
  17. get {
  18. return 200.0
  19. }
  20. }
  21. override func awakeFromNib() {
  22. super.awakeFromNib()
  23. //DDLogDebug("itemSize = \(self.collectionViewDelegate.ItemWithSize)")
  24. self.collectionViewDelegate.delegate = self
  25. self.appCollectionView.dataSource = self.collectionViewDelegate
  26. self.appCollectionView.delegate = self.collectionViewDelegate
  27. }
  28. override func setSelected(_ selected: Bool, animated: Bool) {
  29. super.setSelected(selected, animated: animated)
  30. }
  31. }
  32. extension MainAppActionCell:ZLCollectionViewDelegate{
  33. func clickWithApp(_ app: O2App) {
  34. self.delegate?.clickWithApp(app)
  35. }
  36. }