Commit c7c21a7e authored by David黄金龙's avatar David黄金龙

Merge branch 'davidhuang' into develop

* davidhuang:
  一处代码优化
parents 17149119 e796b9dd
......@@ -397,10 +397,6 @@ class YHFormPickerView: UIView {
return "职业"
case .professionCertificate:
return "选择证书名称"
case .language:
return "选择语言能力"
case .professionalSkill:
return "选择专业技能行业"
case .degreeCategory:
return "选择学位类型"
}
......@@ -676,11 +672,6 @@ extension YHFormPickerView {
} else if title == "其他" {
return .degreeCategory(.others)
}
case .language:
return .none
case .professionalSkill:
return .none
}
return .none
}
......
......@@ -33,10 +33,6 @@ enum YHFormPickerViewType: Int {
case degreeLocation
// 专业证书
case professionCertificate
// 语言能力
case language
// 专业技能行业
case professionalSkill
// 学位类型
case degreeCategory
}
......
......@@ -9,43 +9,15 @@
import UIKit
import AttributedString
//
// YHFormPickerView.swift
// galaxy
//
// Created by edy on 2024/1/29.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
// 【 用法 Usage】
/*
// (1) 直接传type
YHFormPickerView.show(type: .certificate, selectType: .certificate(.otherStatelessTravelPassport)) { selectType in
// 选择类型的标题
print(selectType.title)
}
// (2) 直接传字符串值
YHFormPickerView.show(type: .certificate, selectTitle: "公务通行证") { selectType in
// 选择类型的标题
print(selectType.title)
}
*/
enum YHOtherPickerViewType: Int {
// 按自然顺序递增
case none = 0
// 语言能力
case language
// 专业技能行业
case professionalSkill
}
//class YHOtherPickerView {
//
// let type: YHFormPickerViewSubType
// lazy var title = {
// return type.title
// }()
//
// init(type: YHFormPickerViewSubType) {
// self.type = type
// }
//}
struct YHOtherPickerViewItemData {
let title : String
......@@ -54,7 +26,7 @@ struct YHOtherPickerViewItemData {
}
class YHOtherPickerView: UIView {
private var type : YHFormPickerViewType = .none
private var type : YHOtherPickerViewType = .none
var arrData : [YHOtherPickerViewItemData] = []
private var selectType:YHFormPickerViewSubType?
......@@ -141,7 +113,7 @@ class YHOtherPickerView: UIView {
}()
init(type: YHFormPickerViewType) {
init(type: YHOtherPickerViewType) {
super.init(frame: UIScreen.main.bounds)
self.createUI()
self.type = type
......@@ -157,7 +129,7 @@ class YHOtherPickerView: UIView {
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
static func show(type:YHFormPickerViewType, selectType:YHFormPickerViewSubType? = nil, callBack: @escaping ((YHOtherPickerViewItemData)->Void)) {
static func show(type:YHOtherPickerViewType, selectType:YHFormPickerViewSubType? = nil, callBack: @escaping ((YHOtherPickerViewItemData)->Void)) {
let picker = YHOtherPickerView(type: type)
// picker.selectType = selectType
......@@ -246,8 +218,7 @@ class YHOtherPickerView: UIView {
// }
}
func getTitle(type: YHFormPickerViewType)-> String {
func getTitle(type: YHOtherPickerViewType)-> String {
switch type {
case .language:
return "选择语言能力"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment