MyWalletTableViewHeaderView.swift 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // OpenDetailTableViewHeaderView.swift
  3. // xingchuangke
  4. //
  5. // Created by Virgil on 2019/3/28.
  6. // Copyright © 2019 Virgil. All rights reserved.
  7. //
  8. import UIKit
  9. @objc protocol WalletHeaderViewDelegate {
  10. func segmentDidClickedWithIndex(index: NSInteger)
  11. }
  12. class MyWalletTableViewHeaderView: UIView {
  13. weak open var delegate: WalletHeaderViewDelegate?
  14. var selectedIndex = 0
  15. @IBOutlet weak var lblName: UILabel!
  16. func initView(section: Int) {
  17. lblName.text = "收益详情"
  18. let sgment = XF_Segment.init(frame: CGRect.init(x: 0, y: 50, width: ScreenWidth, height: 50), titles: ["海付POS机", "海付传统POS", "海科传统POS(山东河南)", "快益刷传统POS"], selectedIndex: selectedIndex, defaultColor: CommonUntils.getUIColorFromRGB(rgbValue: 0x333333), selectedColor: CommonUntils.getUIColorFromRGB(rgbValue: 0x2094f5)) { [weak self](index) in
  19. self!.selectedIndex = index
  20. self!.delegate?.segmentDidClickedWithIndex(index: index)
  21. }
  22. self.addSubview(sgment)
  23. }
  24. }