当前位置:网站首页>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
边栏推荐
- LeetCode_ 63_ Different paths II
- A priori, a posteriori, likelihood
- Golang concurrency model
- 注意力机制及代码实现
- Interviewer: what are the usage scenarios of ThreadLocal? How to avoid memory leakage?
- Open source database innovation in the era of digital economy | the 2022 open atom global open source summit database sub forum was successfully held
- MYSQL入门与进阶(十)
- Ue5 gas learning notes 1.6 skills gameplay ability
- 4 年后,Debian 终夺回“debian.community”域名!
- Implementation of grayscale publishing with haproxy
猜你喜欢

MYSQL入门与进阶(八)

Redis缓存雪崩、穿透、击穿,布隆过滤器,分布式锁详解

Getting started with gateway

4 年后,Debian 终夺回“debian.community”域名!

MYSQL入门与进阶(五)
![[actual combat] realize page distortion correction with OpenCV](/img/7b/7e25bde34a9d5463af3dd40599c80e.png)
[actual combat] realize page distortion correction with OpenCV

Gateway入门

湖上建仓全解析:如何打造湖仓一体数据平台 | DEEPNOVA技术荟系列公开课第四期

What kind of knowledge payment system functions are more conducive to the development of the platform and lecturers?

Example of observer mode of C -- ordering milk
随机推荐
2022 Hangdian multi school field 2 1011 DOS card (line segment tree)
Is there any prospect and way out for software testing?
Introduction and advanced level of MySQL (9)
MySQL date function
UE4.25 Slate源码解读
GC垃圾回收器详解
1.3 linked list
Introduction and advanced MySQL (4)
Attention mechanism and code implementation
Use the self-developed proxy server to solve the cross domain access errors encountered when uploading files by SAP ui5 fileuploader trial version
注意力机制及代码实现
配置教程:新版本EasyCVR(v2.5.0)组织结构如何级联到上级平台?
Kotlin:Sealed class密封类详解
2022-07-27 第四小组 修身课 学习笔记(every day)
PyQt5快速开发与实战 5.3 多线程
Open source database innovation in the era of digital economy | the 2022 open atom global open source summit database sub forum was successfully held
Ue5 gas learning notes 1.6 skills gameplay ability
Win11电脑摄像头打开看不见,显示黑屏如何解决?
How to choose between software testing and software development?
Go exe generates icon version information