LNNewVersionView.swift 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // LNNewVersionView.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2026/1/4.
  6. //
  7. import Foundation
  8. import UIKit
  9. import SnapKit
  10. class LNNewVersionView: UIView {
  11. override init(frame: CGRect) {
  12. super.init(frame: frame)
  13. let background = UIImageView()
  14. background.layer.cornerRadius = 8
  15. background.image = .primary_7
  16. background.clipsToBounds = true
  17. background.isUserInteractionEnabled = false
  18. addSubview(background)
  19. background.snp.makeConstraints { make in
  20. make.edges.equalToSuperview()
  21. make.height.equalTo(16)
  22. }
  23. let newLabel = UILabel()
  24. newLabel.font = .body_s
  25. newLabel.textColor = .text_1
  26. newLabel.text = .init(key: "New")
  27. addSubview(newLabel)
  28. newLabel.snp.makeConstraints { make in
  29. make.center.equalToSuperview()
  30. make.leading.equalToSuperview().offset(7)
  31. }
  32. }
  33. required init?(coder: NSCoder) {
  34. fatalError("init(coder:) has not been implemented")
  35. }
  36. }