TSBaseCollectionCell.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // CWBaseCollectionViewCell.swift
  3. // ClockWidget
  4. //
  5. // Created by fff on 2024/11/12.
  6. //
  7. open class TSBaseCollectionCell: UICollectionViewCell {
  8. public var colAttributes:[String : Any]?
  9. public lazy var bgContentView:UIView = {
  10. let view = UIView()
  11. view.backgroundColor = .clear
  12. return view
  13. }()
  14. override init(frame: CGRect) {
  15. super.init(frame: frame)
  16. self.backgroundColor = .clear
  17. self.addSubview(bgContentView)
  18. bgContentView.snp.makeConstraints { make in
  19. make.top.leading.trailing.bottom.equalTo(0)
  20. }
  21. creatUI()
  22. dealThings()
  23. }
  24. required public init?(coder: NSCoder) {
  25. fatalError("init(coder:) has not been implemented")
  26. }
  27. open func creatUI(){
  28. }
  29. open func dealThings(){
  30. }
  31. deinit {
  32. // debugPrint("<---deinit \(String(describing: self))")
  33. }
  34. }
  35. open class TSBaseCollectionnReusableView : UICollectionReusableView {
  36. public lazy var bgContentView:UIView = {
  37. let view = UIView()
  38. view.backgroundColor = .clear
  39. return view
  40. }()
  41. override init(frame: CGRect) {
  42. super.init(frame: frame)
  43. self.backgroundColor = .clear
  44. self.addSubview(bgContentView)
  45. bgContentView.snp.makeConstraints { make in
  46. make.top.leading.trailing.bottom.equalTo(0)
  47. }
  48. creatUI()
  49. }
  50. required public init?(coder: NSCoder) {
  51. fatalError("init(coder:) has not been implemented")
  52. }
  53. open func creatUI(){
  54. }
  55. deinit {
  56. // debugPrint("<---deinit \(String(describing: self))")
  57. }
  58. }