OOContactSearchSectionHeaderView.swift 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // OOContactSearchSectionHeaderView.swift
  3. // o2app
  4. //
  5. // Created by 刘振兴 on 2017/11/28.
  6. // Copyright © 2017年 zone. All rights reserved.
  7. //
  8. import UIKit
  9. enum OOContacSearchSectionHeaderType:Int{
  10. case unit = 0
  11. case person = 1
  12. case group = 2
  13. case all = 3
  14. }
  15. class OOContactSearchSectionHeaderView: UIView {
  16. @IBOutlet weak var iconImageView: UIImageView!
  17. @IBOutlet weak var sectionTitle: UILabel!
  18. required init?(coder aDecoder: NSCoder) {
  19. super.init(coder: aDecoder)
  20. }
  21. public func setHeaderType(_ headerType:OOContacSearchSectionHeaderType){
  22. let (iconName,title) = searchHeaderTypes[headerType]!
  23. self.iconImageView.image = UIImage(named:iconName)
  24. self.sectionTitle.text = title
  25. }
  26. private let searchHeaderTypes:[OOContacSearchSectionHeaderType:(String,String)] = [.unit:(O2ThemeManager.string(for: "Icon.icon_bumen")!,"组织"),.person:(O2ThemeManager.string(for: "Icon.icon_linkman")!,"联系人"),.group:(O2ThemeManager.string(for: "Icon.icon_group")!,"群组")]
  27. }