UIImageView+Theme.swift 1010 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // UIImageView+Theme.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/19.
  6. //
  7. import Foundation
  8. extension UIImageView {
  9. static func arrowImageView(size: CGFloat, weight: UIImage.SymbolWeight = .regular) -> UIImageView {
  10. let config = UIImage.SymbolConfiguration(pointSize: size, weight: weight)
  11. let arrow = UIImageView()
  12. arrow.image = .init(systemName: "chevron.forward", withConfiguration: config)
  13. return arrow
  14. }
  15. static func coinImageView(_ big: Bool = false) -> UIImageView {
  16. let coin = UIImageView()
  17. coin.image = big ? .icCoin42 : .icCoin
  18. return coin
  19. }
  20. static func diamondImageView(_ big: Bool = false) -> UIImageView {
  21. let diamond = UIImageView()
  22. diamond.image = big ? .icDiamond42 : .icDiamond
  23. return diamond
  24. }
  25. static func beanImageView() -> UIImageView {
  26. let bean = UIImageView()
  27. bean.image = .icBean
  28. return bean
  29. }
  30. }