Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
df29bb15
Commit
df29bb15
authored
Mar 05, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 字数限制
parent
eaeb8a6f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
9 deletions
+85
-9
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+4
-0
YHChildPrimaryInfoVC.swift
...ilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
+3
-3
YHSpousePrimaryInfoVC.swift
...yMember(家庭成员信息表)/C/Spouse(配偶)/YHSpousePrimaryInfoVC.swift
+3
-3
YHCertificateInfoController.swift
...FamilyMember(家庭成员信息表)/C/YHCertificateInfoController.swift
+22
-0
YHFormItemInputTextCell.swift
...流程)/FamilyMember(家庭成员信息表)/V/YHFormItemInputTextCell.swift
+3
-3
UITextField+Extension.swift
...alaxy/Classes/Tools/Extention/UITextField+Extension.swift
+50
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
df29bb15
...
...
@@ -74,6 +74,7 @@
0468D47E2B68CEA200CFB916
/* YHImagePickerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
;
};
0468D4802B6914E600CFB916
/* YHSelectCountryViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
;
};
0468D4822B6A2A8500CFB916
/* YHSelectCountryViewModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
;
};
04754A952B96FF3D00F8ADCA
/* UITextField+Extension.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04754A942B96FF3D00F8ADCA
/* UITextField+Extension.swift */
;
};
04808C062B4686510056D53C
/* ATAuthSDK.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
;
};
04808C082B4686C10056D53C
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
...
...
@@ -379,6 +380,7 @@
0468D47D2B68CEA200CFB916
/* YHImagePickerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHImagePickerView.swift
;
sourceTree
=
"<group>"
;
};
0468D47F2B6914E600CFB916
/* YHSelectCountryViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewController.swift
;
sourceTree
=
"<group>"
;
};
0468D4812B6A2A8500CFB916
/* YHSelectCountryViewModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSelectCountryViewModel.swift
;
sourceTree
=
"<group>"
;
};
04754A942B96FF3D00F8ADCA
/* UITextField+Extension.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"UITextField+Extension.swift"
;
sourceTree
=
"<group>"
;
};
04808C032B4686510056D53C
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04808C042B4686510056D53C
/* ATAuthSDK.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
path
=
ATAuthSDK.bundle
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -1367,6 +1369,7 @@
A5ACE9022B4564F7002C94D2
/* AppDelegate+Extension.swift */
,
A5ACE9032B4564F7002C94D2
/* UILable+Extension.swift */
,
A5ACE9042B4564F7002C94D2
/* Array+Extension.swift */
,
04754A942B96FF3D00F8ADCA
/* UITextField+Extension.swift */
,
);
path
=
Extention
;
sourceTree
=
"<group>"
;
...
...
@@ -1909,6 +1912,7 @@
A5ACE9412B4564F7002C94D2
/* Dictionary+Extension.swift in Sources */
,
A5C5B3102B57677300A7C5D1
/* YHGestureTableView.swift in Sources */
,
A5167B272B692CF20084C08F
/* YHPreviewInfoCertificatePictureItemView.swift in Sources */
,
04754A952B96FF3D00F8ADCA
/* UITextField+Extension.swift in Sources */
,
A5ACE9312B4564F7002C94D2
/* YHPersonalCenterCell.swift in Sources */
,
04E86E5D2B84CC9700A35F4B
/* YHWorkExampleMessageView.swift in Sources */
,
A5ACE9532B4564F7002C94D2
/* YHBaseViewController.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
View file @
df29bb15
...
...
@@ -268,10 +268,10 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell
.
text
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
cell
.
textInputCondtion
=
{
text
in
if
let
textStr
=
text
{
text
Field
in
if
let
textStr
=
text
Field
.
text
{
let
max
=
100
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
text
Field
.
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
}
return
true
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Spouse(配偶)/YHSpousePrimaryInfoVC.swift
View file @
df29bb15
...
...
@@ -234,10 +234,10 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
cell
.
textInputCondtion
=
{
text
in
if
let
textStr
=
text
{
text
Field
in
if
let
textStr
=
text
Field
.
text
{
let
max
=
100
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
text
Field
.
text
=
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
}
return
true
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/YHCertificateInfoController.swift
View file @
df29bb15
...
...
@@ -153,6 +153,28 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
cell
.
title
=
detailItem
.
getTitle
()
cell
.
text
=
detailItem
.
value
cell
.
setTips
(
detailItem
.
tips
,
isShow
:
isNeedShowError
&&
detailItem
.
isShowTips
)
cell
.
textInputCondtion
=
{
textField
in
var
max
=
-
1
if
detailItem
.
type
==
.
chinaIdentityCardNumber
{
// 身份证
max
=
18
}
else
if
detailItem
.
type
==
.
certificateSignPlace
{
// 签发地
max
=
100
}
else
if
detailItem
.
type
==
.
traverlPassportNumber
||
detailItem
.
type
==
.
certificateNumber
{
max
=
50
}
if
max
>
0
{
if
let
textStr
=
textField
.
text
{
textField
.
text
=
(
textStr
.
count
>
max
?
textStr
[
safe
:
..<
max
]
:
textStr
)
}
}
return
true
}
cell
.
textChange
=
{
[
weak
self
]
(
text
,
isEditEnd
)
in
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/V/YHFormItemInputTextCell.swift
View file @
df29bb15
...
...
@@ -22,7 +22,7 @@ class YHFormItemInputTextCell: UITableViewCell {
}
// BOOL值表示编辑是否结束
var
textChange
:((
String
?,
Bool
)
->
Void
)?
var
textInputCondtion
:((
inout
String
?
)
->
Bool
)?
var
textInputCondtion
:((
UITextField
)
->
Bool
)?
var
title
:
String
?
{
didSet
{
...
...
@@ -165,7 +165,7 @@ class YHFormItemInputTextCell: UITableViewCell {
@objc
func
textFieldChanged
(
textField
:
UITextField
)
{
if
let
textChange
=
textChange
{
if
let
textInputCondtion
=
textInputCondtion
{
if
textInputCondtion
(
&
textField
.
text
)
{
if
textInputCondtion
(
self
.
textField
)
{
textChange
(
textField
.
text
,
false
)
}
}
else
{
...
...
@@ -177,7 +177,7 @@ class YHFormItemInputTextCell: UITableViewCell {
@objc
func
textFieldEditEnd
(
textField
:
UITextField
)
{
if
let
textChange
=
textChange
{
if
let
textInputCondtion
=
textInputCondtion
{
if
textInputCondtion
(
&
textField
.
text
)
{
if
textInputCondtion
(
self
.
textField
)
{
textChange
(
textField
.
text
,
true
)
}
}
else
{
...
...
galaxy/galaxy/Classes/Tools/Extention/UITextField+Extension.swift
0 → 100644
View file @
df29bb15
//
// UITextField+Extension.swift
// galaxy
//
// Created by edy on 2024/3/5.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
extension
UITextField
{
/// 限制textField输入
public
func
limitInputWithPattern
(
pattern
:
String
,
_
limitCount
:
Int
=
-
1
)
{
// 非markedText才继续往下处理
guard
let
_
:
UITextRange
=
self
.
markedTextRange
else
{
// 当前光标的位置(后面会对其做修改)
let
cursorPostion
=
self
.
offset
(
from
:
self
.
endOfDocument
,
to
:
self
.
selectedTextRange
!.
end
)
// 替换后的字符串
var
str
=
""
if
pattern
==
""
{
str
=
self
.
text
!
}
else
{
str
=
self
.
text
!.
regularReplace
(
pattern
:
pattern
,
with
:
""
)
}
// 如果长度超过限制则直接截断
if
limitCount
>=
0
,
str
.
count
>
limitCount
{
str
=
String
(
str
.
prefix
(
limitCount
))
}
self
.
text
=
str
// 让光标停留在正确位置
let
targetPostion
=
self
.
position
(
from
:
self
.
endOfDocument
,
offset
:
cursorPostion
)
!
self
.
selectedTextRange
=
self
.
textRange
(
from
:
targetPostion
,
to
:
targetPostion
)
return
}
}
}
extension
String
{
// 使用正则表达式替换
func
regularReplace
(
pattern
:
String
,
with
:
String
,
options
:
NSRegularExpression
.
Options
=
[])
->
String
{
let
regex
=
try!
NSRegularExpression
(
pattern
:
pattern
,
options
:
options
)
return
regex
.
stringByReplacingMatches
(
in
:
self
,
options
:
[],
range
:
NSMakeRange
(
0
,
self
.
count
),
withTemplate
:
with
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment