TSBaseCollectionCell.swift 1.6 KB

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