fix: Issue with prevent screenshots implementation on iOS (#1729)
Some checks failed
Cache Dependencies / test (push) Has been cancelled

This commit is contained in:
David Adegoke 2024-10-24 04:20:25 +01:00 committed by GitHub
parent 68926c0a33
commit 4372165b26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,12 +110,12 @@ import workmanager
private func makeSecure() { private func makeSecure() {
if (!self.window.subviews.contains(textField)) { if (!self.window.subviews.contains(textField)) {
let view = UIView(frame: CGRect(x: 0, y: 0, width: textField.frame.self.width, height: textField.frame.self.height))
self.window.addSubview(textField) self.window.addSubview(textField)
textField.centerYAnchor.constraint(equalTo: self.window.centerYAnchor).isActive = true
textField.centerXAnchor.constraint(equalTo: self.window.centerXAnchor).isActive = true
self.window.layer.superlayer?.addSublayer(textField.layer) self.window.layer.superlayer?.addSublayer(textField.layer)
textField.layer.sublayers?.first?.addSublayer(self.window.layer) textField.layer.sublayers?.last!.addSublayer(self.window.layer)
textField.leftView = view
textField.leftViewMode = .always
} }
} }
} }