Skip to content

realWayneZhang/WMPasswordView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

WMPasswordView

Swift4.2 仿微信、支付宝输入支付密码

效果展示

Usage

把WMPasswordView文件夹拖入项目中, 代码如下:

class ViewController: UIViewController {
    @IBOutlet weak var payPwdLabel: UILabel!
    /// lazy load
    lazy var payPasswordView: WMPasswordView = {
        let pwdView = WMPasswordView(type: WMPwdType.payPwd, amount: 250.0)
        /// 回调 closure 可以在本类任意方法类写
        pwdView.completed = { [weak self] pwd in
            self?.payPwdLabel?.text = "输入的密码:" + pwd
        }
        return pwdView
    }()
    /// 类方法调用
    @IBAction func classFunction() {
        WMPasswordView.show(type: WMPwdType.payPwd, amount: 1200.0) { [weak self] pwd in
            self?.payPwdLabel?.text = "输入的密码:" + pwd
        }
    }
    /// 实例方法调用
    @IBAction func instanceFunction() {
        payPasswordView.show()
    }
}

如果对您有帮助,请给个Star!😄,Thank you for look!

About

仿微信、支付宝输入支付密码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages