添加 SPayPassWordView.swift到项目
在Xib/storyboard中添加一个 View
设置 View的class为 SPayPassWordView
设置相关属性
let payPassWordView = SPayPassWordView(frame: CGRect(x: 0, y: 0, width: 300, height: 40))
payPassWordView.lenght = 6
payPassWordView.borderColor = .blue
payPassWordView.borderRadius = 10
payPassWordView.starColor = .cyan
payPassWordView.delegate = self
extension ViewController: SPayPassWordViewDelegate{
func entryComplete(password: String) {
label.text = "password: \(password)"
}
}