PQCuttingPointView.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. import BFCommonKit
  10. class PQCuttingPointView: UIView {
  11. lazy var pointView: UIView = {
  12. let pointView = UIView()
  13. pointView.addCorner(corner: 1.5)
  14. pointView.backgroundColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  15. return pointView
  16. }()
  17. lazy var dragingImageView: UIImageView = {
  18. let dragingImageView = UIImageView(image:UIImage.moduleImage(named: "stuckPoint_dragingImage", moduleName: "BFFramework",isAssets: false)?.withRenderingMode(.alwaysTemplate))
  19. dragingImageView.tintColor = UIColor.hexColor(hexadecimal: PQBFConfig.shared.styleColor.rawValue)
  20. return dragingImageView
  21. }()
  22. override init(frame: CGRect) {
  23. super.init(frame: frame)
  24. isUserInteractionEnabled = true
  25. addSubview(pointView)
  26. addSubview(dragingImageView)
  27. dragingImageView.frame = CGRect(x: (frame.width - 12) / 2, y: frame.height - 14, width: 12, height: 14)
  28. pointView.frame = CGRect(x: (frame.width - 3) / 2, y: 0, width: 3, height: frame.height - dragingImageView.frame.height + 2)
  29. }
  30. required init?(coder _: NSCoder) {
  31. fatalError("init(coder:) has not been implemented")
  32. }
  33. deinit {
  34. BFLog(message: "卡点裁剪-指示器销毁")
  35. }
  36. }