PQCuttingPointView.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // PQCuttingPointView.swift
  3. // PQSpeed
  4. //
  5. // Created by SanW on 2021/5/12.
  6. // Copyright © 2021 BytesFlow. All rights reserved.
  7. //
  8. import UIKit
  9. class PQCuttingPointView: UIView {
  10. lazy var pointView: UIView = {
  11. let pointView = UIView()
  12. pointView.addCorner(corner: 1.5)
  13. pointView.backgroundColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  14. return pointView
  15. }()
  16. lazy var dragingImageView: UIImageView = {
  17. let dragingImageView = UIImageView(image: UIImage().BF_Image(named: "stuckPoint_dragingImage").withRenderingMode(.alwaysTemplate))
  18. dragingImageView.tintColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  19. return dragingImageView
  20. }()
  21. override init(frame: CGRect) {
  22. super.init(frame: frame)
  23. isUserInteractionEnabled = true
  24. addSubview(pointView)
  25. addSubview(dragingImageView)
  26. dragingImageView.frame = CGRect(x: (frame.width - 12) / 2, y: frame.height - 14, width: 12, height: 14)
  27. pointView.frame = CGRect(x: (frame.width - 3) / 2, y: 0, width: 3, height: frame.height - dragingImageView.frame.height + 2)
  28. }
  29. required init?(coder _: NSCoder) {
  30. fatalError("init(coder:) has not been implemented")
  31. }
  32. deinit {
  33. BFLog(message: "卡点裁剪-指示器销毁")
  34. }
  35. }