No Description

BottomCancelItem.swift 885B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // BottomCancelItem.swift
  3. // PaiaiUIKit
  4. //
  5. // Created by ffib on 2019/1/21.
  6. // Copyright © 2019 yb. All rights reserved.
  7. //
  8. import UIKit
  9. final class BottomCancelItem: AlertItem {
  10. static var `default`: BottomCancelItem {
  11. return BottomCancelItem()
  12. }
  13. init() {
  14. super.init(frame: CGRect.zero)
  15. initProperty()
  16. }
  17. override func didMoveToWindow() {
  18. installTarget()
  19. }
  20. private func initProperty() {
  21. titleLabel?.numberOfLines = 0
  22. titleLabel?.font = UIFont.systemFont(ofSize: 17)
  23. backgroundColor = UIColor.white
  24. setTitleColor(UIColor(r: 51, g: 51, b: 51), for: .normal)
  25. }
  26. private func installTarget() {
  27. guard let vc = getSuperViewController() else { return }
  28. addTarget(vc, action: #selector(AlertViewController.disappear), for: .touchDown)
  29. }
  30. }