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

一处代码优化

parent efec0321
...@@ -397,10 +397,6 @@ class YHFormPickerView: UIView { ...@@ -397,10 +397,6 @@ class YHFormPickerView: UIView {
return "职业" return "职业"
case .professionCertificate: case .professionCertificate:
return "选择证书名称" return "选择证书名称"
case .language:
return "选择语言能力"
case .professionalSkill:
return "选择专业技能行业"
case .degreeCategory: case .degreeCategory:
return "选择学位类型" return "选择学位类型"
} }
...@@ -676,11 +672,6 @@ extension YHFormPickerView { ...@@ -676,11 +672,6 @@ extension YHFormPickerView {
} else if title == "其他" { } else if title == "其他" {
return .degreeCategory(.others) return .degreeCategory(.others)
} }
case .language:
return .none
case .professionalSkill:
return .none
} }
return .none return .none
} }
......
...@@ -33,10 +33,6 @@ enum YHFormPickerViewType: Int { ...@@ -33,10 +33,6 @@ enum YHFormPickerViewType: Int {
case degreeLocation case degreeLocation
// 专业证书 // 专业证书
case professionCertificate case professionCertificate
// 语言能力
case language
// 专业技能行业
case professionalSkill
// 学位类型 // 学位类型
case degreeCategory case degreeCategory
} }
......
...@@ -9,43 +9,15 @@ ...@@ -9,43 +9,15 @@
import UIKit import UIKit
import AttributedString import AttributedString
// enum YHOtherPickerViewType: Int {
// YHFormPickerView.swift // 按自然顺序递增
// galaxy case none = 0
// // 语言能力
// Created by edy on 2024/1/29. case language
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved. // 专业技能行业
// case professionalSkill
}
// 【 用法 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)
}
*/
//class YHOtherPickerView {
//
// let type: YHFormPickerViewSubType
// lazy var title = {
// return type.title
// }()
//
// init(type: YHFormPickerViewSubType) {
// self.type = type
// }
//}
struct YHOtherPickerViewItemData { struct YHOtherPickerViewItemData {
let title : String let title : String
...@@ -54,7 +26,7 @@ struct YHOtherPickerViewItemData { ...@@ -54,7 +26,7 @@ struct YHOtherPickerViewItemData {
} }
class YHOtherPickerView: UIView { class YHOtherPickerView: UIView {
private var type : YHFormPickerViewType = .none private var type : YHOtherPickerViewType = .none
var arrData : [YHOtherPickerViewItemData] = [] var arrData : [YHOtherPickerViewItemData] = []
private var selectType:YHFormPickerViewSubType? private var selectType:YHFormPickerViewSubType?
...@@ -141,7 +113,7 @@ class YHOtherPickerView: UIView { ...@@ -141,7 +113,7 @@ class YHOtherPickerView: UIView {
}() }()
init(type: YHFormPickerViewType) { init(type: YHOtherPickerViewType) {
super.init(frame: UIScreen.main.bounds) super.init(frame: UIScreen.main.bounds)
self.createUI() self.createUI()
self.type = type self.type = type
...@@ -157,7 +129,7 @@ class YHOtherPickerView: UIView { ...@@ -157,7 +129,7 @@ class YHOtherPickerView: UIView {
UIApplication.shared.yhKeyWindow()?.addSubview(self) 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) let picker = YHOtherPickerView(type: type)
// picker.selectType = selectType // picker.selectType = selectType
...@@ -246,8 +218,7 @@ class YHOtherPickerView: UIView { ...@@ -246,8 +218,7 @@ class YHOtherPickerView: UIView {
// } // }
} }
func getTitle(type: YHFormPickerViewType)-> String { func getTitle(type: YHOtherPickerViewType)-> String {
switch type { switch type {
case .language: case .language:
return "选择语言能力" 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