SafetyPay is a security payment password demo
- Using enumerations to define
safetyPayStyle
types
/// 安全支付样式
///
/// - ciphertext: 密文
/// - Plaintext: 明文
enum safetyPayStyle {
/// 密文
case ciphertext
/// 明文
case plaintext
}
style = .plaintext |
style = .ciphertext |
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
/***** SafetyPayView *****/
let vi = SafetyPayView(frame: CGRect(x: (view.bounds.width - 300) / 2, y: 200, width: 300, height: 50))
vi.style = .plaintext
view.addSubview(vi)
}
}