Commit 77e84170 authored by Steven杜宇's avatar Steven杜宇

// 选择器

parent 91eb9405
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */; }; 042FBBC72B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */; };
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; }; 042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */; };
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */; }; 042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */; };
042FBBD12B673CEF00F9DE23 /* YHFormPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBD02B673CEF00F9DE23 /* YHFormPickerView.swift */; }; 042FBBD42B67A2FE00F9DE23 /* YHFormPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 042FBBD32B67A2F900F9DE23 /* YHFormPickerView.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; }; 0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; }; 0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; }; 0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInitialInfoVC.swift; sourceTree = "<group>"; }; 042FBBC62B64CFBF00F9DE23 /* YHChildInitialInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildInitialInfoVC.swift; sourceTree = "<group>"; };
042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemExpireDateCell.swift; sourceTree = "<group>"; }; 042FBBC82B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormItemExpireDateCell.swift; sourceTree = "<group>"; };
042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildBasicInfoVC.swift; sourceTree = "<group>"; }; 042FBBCA2B65058000F9DE23 /* YHChildBasicInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHChildBasicInfoVC.swift; sourceTree = "<group>"; };
042FBBD02B673CEF00F9DE23 /* YHFormPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormPickerView.swift; sourceTree = "<group>"; }; 042FBBD32B67A2F900F9DE23 /* YHFormPickerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHFormPickerView.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; }; 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; }; 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; }; 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
...@@ -396,7 +396,7 @@ ...@@ -396,7 +396,7 @@
041B52892B5E14EB007EBCEB /* View */ = { 041B52892B5E14EB007EBCEB /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
042FBBCF2B673CCF00F9DE23 /* PickerView */, 042FBBD22B67A2F900F9DE23 /* PickerView */,
041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */, 041B52922B5E6CBA007EBCEB /* YHFormItemTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */, 041B52942B5E7037007EBCEB /* YHFormItemAddCell.swift */,
041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */, 041B528A2B5E15F1007EBCEB /* YHFormItemQuestionCell.swift */,
...@@ -435,10 +435,10 @@ ...@@ -435,10 +435,10 @@
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
042FBBCF2B673CCF00F9DE23 /* PickerView */ = { 042FBBD22B67A2F900F9DE23 /* PickerView */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
042FBBD02B673CEF00F9DE23 /* YHFormPickerView.swift */, 042FBBD32B67A2F900F9DE23 /* YHFormPickerView.swift */,
); );
path = PickerView; path = PickerView;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1170,11 +1170,11 @@ ...@@ -1170,11 +1170,11 @@
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */, 0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */,
A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */, A5ACE9362B4564F7002C94D2 /* YHNetworkStatusManager.swift in Sources */,
A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */, A5ACE92C2B4564F7002C94D2 /* YHLoginStyleButton.swift in Sources */,
042FBBD42B67A2FE00F9DE23 /* YHFormPickerView.swift in Sources */,
A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */, A5ACE92F2B4564F7002C94D2 /* YHMyViewController.swift in Sources */,
A5C5B2E62B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift in Sources */, A5C5B2E62B4EC0BF00A7C5D1 /* YHDavidTestViewController.swift in Sources */,
A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */, A5ACE9332B4564F7002C94D2 /* NetBaseModel.swift in Sources */,
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */, 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */,
042FBBD12B673CEF00F9DE23 /* YHFormPickerView.swift in Sources */,
A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */, A5C5B3002B55623800A7C5D1 /* YHMainContentBaseViewController.swift in Sources */,
A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */, A5573ED22B317BFF00D98EC0 /* AppDelegate.swift in Sources */,
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */, A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
......
...@@ -11,10 +11,15 @@ import UIKit ...@@ -11,10 +11,15 @@ import UIKit
enum YHFormPickerViewType: Int { enum YHFormPickerViewType: Int {
// 按自然顺序递增 // 按自然顺序递增
case none = 0 case none = 0
// 学位
case degree = 1 case degree = 1
// 婚姻
case marriage = 2 case marriage = 2
// 授课形式
case edution = 3 case edution = 3
// 职业
case occupation = 4 case occupation = 4
// 性别
case gender = 5 case gender = 5
} }
...@@ -344,13 +349,26 @@ class YHFormPickerView: UIView { ...@@ -344,13 +349,26 @@ class YHFormPickerView: UIView {
whiteContentView.addSubview(topView) whiteContentView.addSubview(topView)
whiteContentView.addSubview(pickerView) whiteContentView.addSubview(pickerView)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(16.0, 16.0));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
if let title = title {
titleLabel.text = title
} else {
titleLabel.text = getTitle(type: type)
}
blackMaskView.snp.makeConstraints { make in blackMaskView.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
} }
whiteContentView.snp.makeConstraints { make in whiteContentView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview() make.left.right.bottom.equalToSuperview()
make.top.equalToSuperview().offset(KScreenHeight/3.0) make.top.equalToSuperview().offset(KScreenHeight*2/3.0)
} }
topView.snp.makeConstraints { make in topView.snp.makeConstraints { make in
...@@ -409,6 +427,24 @@ class YHFormPickerView: UIView { ...@@ -409,6 +427,24 @@ class YHFormPickerView: UIView {
} }
} }
} }
func getTitle(type: YHFormPickerViewType)-> String {
switch type {
case .none:
return ""
case .degree:
return "选择学位"
case .marriage:
return "选择婚姻状况"
case .edution:
return "选择学位"
case .occupation:
return "选择职业"
case .gender:
return "选择性别"
}
}
} }
extension YHFormPickerView: UIPickerViewDelegate, UIPickerViewDataSource { extension YHFormPickerView: UIPickerViewDelegate, UIPickerViewDataSource {
......
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