-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hidden card data on screenshot (#13)
* Hidden card data on screenshot * Bump Requirements
- Loading branch information
Showing
7 changed files
with
69 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
PUPaymentCard/Sources/PUPaymentCard/Widget/SecureField.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import UIKit | ||
|
||
class SecureField: UITextField { | ||
|
||
// MARK: - Initialization | ||
override init(frame: CGRect) { | ||
super.init(frame: .zero) | ||
self.isSecureTextEntry = true | ||
self.translatesAutoresizingMaskIntoConstraints = false | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: - Public Properties | ||
weak var secureContainer: UIView? { | ||
let secureView = self.subviews.filter({ subview in | ||
type(of: subview).description().contains("CanvasView") | ||
}).first | ||
secureView?.translatesAutoresizingMaskIntoConstraints = false | ||
secureView?.isUserInteractionEnabled = true | ||
|
||
return secureView | ||
} | ||
|
||
// MARK: - Overrides | ||
override var canBecomeFirstResponder: Bool {false} | ||
override func becomeFirstResponder() -> Bool {false} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters