SignatureViewCell.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // SignatureViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2018/9/18.
  6. // Copyright © 2018 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. import Eureka
  10. public class SignatureViewCell: Cell<String>, CellType {
  11. @IBOutlet weak var clearBtn: UIImageView!
  12. @IBOutlet weak var signView: O2UISignatureView!
  13. @IBOutlet weak var signViewHeightConstraint: NSLayoutConstraint!
  14. public override func setup() {
  15. super.setup()
  16. let width = UIScreen.main.bounds.width
  17. print("screen width:\(width)")
  18. let height = width * 2 / 3
  19. print(" cal height:\(height)")
  20. self.signViewHeightConstraint.constant = height
  21. self.height = {return height}
  22. clearBtn.addTapGesture { (ges) in
  23. self.signView.clearSignature()
  24. }
  25. }
  26. }
  27. public final class SignatureViewRow: Row<SignatureViewCell>, RowType {
  28. public required init(tag: String?) {
  29. super.init(tag: tag)
  30. // 我们把对应SignatureViewCell的 .xib 加载到cellProvidor
  31. cellProvider = CellProvider<SignatureViewCell>(nibName: "SignatureViewCell")
  32. }
  33. }