AddSoundCell.swift 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // AddSoundCell.swift
  3. // Bark
  4. //
  5. // Created by Fin on 2024/3/29.
  6. // Copyright © 2024 Fin. All rights reserved.
  7. //
  8. import UIKit
  9. class AddSoundCell: UITableViewCell {
  10. let button: UIButton = {
  11. let button = UIButton(type: .system)
  12. button.setTitle(NSLocalizedString("uploadSound"), for: .normal)
  13. button.setImage(UIImage(named: "music_note-music_note_symbol"), for: .normal)
  14. button.setTitleColor(BKColor.lightBlue.darken3, for: .normal)
  15. button.tintColor = BKColor.lightBlue.darken3
  16. button.titleLabel?.font = UIFont.systemFont(ofSize: 16)
  17. // 从 UITableView didSelectRowAt 那响应点击事件
  18. button.isUserInteractionEnabled = false
  19. return button
  20. }()
  21. override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  22. super.init(style: style, reuseIdentifier: reuseIdentifier)
  23. self.selectionStyle = .none
  24. contentView.addSubview(button)
  25. button.snp.makeConstraints { make in
  26. make.edges.equalToSuperview()
  27. make.height.equalTo(44)
  28. }
  29. }
  30. required init?(coder: NSCoder) {
  31. fatalError("init(coder:) has not been implemented")
  32. }
  33. }