This file contains hidden or 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
| public struct SecureView<Content: View>: UIViewRepresentable { | |
| let content: () -> Content | |
| public init(@ViewBuilder content: @escaping () -> Content) { | |
| self.content = content | |
| } | |
| public func makeUIView(context: Context) -> UIView { | |
| let secureTextField = UITextField() | |
| secureTextField.isSecureTextEntry = true |
This file contains hidden or 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
| func calculateRectBetween(lastPoint: CGPoint, newPoint: CGPoint) -> CGRect { | |
| let originX = min(lastPoint.x, newPoint.x) - (lineWidth / 2) | |
| let originY = min(lastPoint.y, newPoint.y) - (lineWidth / 2) | |
| let maxX = max(lastPoint.x, newPoint.x) + (lineWidth / 2) | |
| let maxY = max(lastPoint.y, newPoint.y) + (lineWidth / 2) | |
| let width = maxX - originX | |
| let height = maxY - originY |