当前位置:网站首页>Swiftui component how to implement textfield of hidden part of phone number mask (tutorial includes source code)
Swiftui component how to implement textfield of hidden part of phone number mask (tutorial includes source code)
2022-07-28 18:55:00 【Knowledge fatness】
SwiftUI There is no phone mask tool , Need to use UIKit.
In this paper , We will study : Use UIKit Written register to SwiftUI Use a mobile mask for the project .

- stay SwiftUI Create views on
import SwiftUI
struct NumberPhoneMaskView: View {
let maskPhone = "+X-XXX-XXX-XX-XX"
@State var text = ""
var body: some View {
VStack {
let textChangedBinding = Binding<String>(
get: {
FilterNumberPhone.format(with: self.maskPhone, phone: self.text)},
set: { self.text = $0
})
TextFieldContainer("+1", text: textChangedBinding)
}.padding()
}
}
struct NumberPhoneMaskView_Previews: PreviewProvider {
static var previews: some View {
NumberPhoneMaskView()
}
}
- Create a TextFieldContainer structure &#x
边栏推荐
- kotlin:out in
- 2022.7.26 constructor, interview: the role of new, deep copy and shallow copy
- 专题讲座6 树形dp 学习心得(长期更新)
- 广告推荐CTR点击率预测实践项目!
- Easynlp Chinese text and image generation model takes you to become an artist in seconds
- Ue5 gas learning notes 1.10 prediction
- CTR click through rate prediction practice project of advertising recommendation!
- Apple develops a complete creation process of Apple certificate and description file
- 使用自开发的代理服务器解决 SAP UI5 FileUploader 上传文件时遇到的跨域访问错误试读版
- LeetCode_63_不同路径Ⅱ
猜你喜欢

LeetCode_96_不同的二叉搜索树

One Hot编码是什么?为什么要用它,什么时候用它?

kotlin:Nothing

2022-07-27 第四小组 修身课 学习笔记(every day)

New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held

“讳疾忌医”的开源走不远

How to use the white list function of the video fusion cloud service easycvr platform?

Record your interview experience in Xiamen for two years -- Conclusion

2022-07-27 study notes of group 4 self-cultivation class (every day)

2022年中国企业服务产业市场行情
随机推荐
真正的 HTAP 对用户和开发者意味着什么?
If you want to learn software testing, where can you learn zero foundation?
What is the future of software testing? How to learn?
现代化个人博客系统 ModStartBlog v5.4.0 登录界面改版,新增联系方式
EasyCVR新版本级联时,下级平台向上传递层级目录显示不全的原因分析
Bubble sorting and Related videos
Ue5 gas learning notes 1.8 game special effects (gameplaycue)
C# 之 观察者模式实例 -- 订牛奶
行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
One Hot编码是什么?为什么要用它,什么时候用它?
AI has changed thousands of industries. How can developers devote themselves to the new "sound" state of AI voice
LeetCode_ 1137_ Nth teponacci number
LeetCode_ 343_ integer partition
Go concurrency one
408复习策略(强化阶段)
Kotlin:sealed Class detailed explanation of sealed class
N32替换STM32,这些细节别忽略!
Why app uses JSON protocol to interact with server: serialization related knowledge
Introduction and advanced MySQL (7)
GC garbage collector details