OOFormSegueItemView.swift 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // OOFormSegueItemView.swift
  3. // o2app
  4. //
  5. // Created by 刘振兴 on 2018/1/26.
  6. // Copyright © 2018年 zone. All rights reserved.
  7. //
  8. import UIKit
  9. class OOFormSegueItemView: OOFormBaseView,OOFormConfigEnable {
  10. @IBOutlet weak var titleNameLabel: UILabel!
  11. @IBOutlet weak var showValueLabel: UILabel!
  12. var backCallAction:((_ sender:Any?) -> Void)?
  13. // 选择会议室
  14. @IBAction func chooseRoomAction(_ sender: UITapGestureRecognizer) {
  15. guard let block = backCallAction else {
  16. return
  17. }
  18. block(sender)
  19. }
  20. override func awakeFromNib() {
  21. showValueLabel.isHidden = true
  22. }
  23. override init(frame: CGRect) {
  24. super.init(frame: frame)
  25. }
  26. required init?(coder aDecoder: NSCoder) {
  27. super.init(coder: aDecoder)
  28. }
  29. func configItem(_ model: OOFormBaseModel) {
  30. self.model = model
  31. titleNameLabel.text = self.model?.titleName
  32. if let value = model.callbackValue, let room = value as? OOMeetingRoomInfo {
  33. showValueLabel.isHidden = false
  34. showValueLabel.text = room.name
  35. }
  36. }
  37. // 选择会议室
  38. @IBAction func performVC(_ sender: Any) {
  39. guard let block = backCallAction else {
  40. return
  41. }
  42. block(sender)
  43. }
  44. func setBackValueUpdate(_ room:OOMeetingRoomInfo){
  45. self.model?.callbackValue = room
  46. self.showValueLabel.text = room.name
  47. self.showValueLabel.isHidden = false
  48. }
  49. }