Prevent screenshot with 'isSecureTextEntry' is not working on iOS 17

I am using ‘isSecureTextEntry' on iOS 16 with this solution, https://stackoverflow.com/a/76390952/22598343

extension UIView {
    func makeSecure() {
        DispatchQueue.main.async {
            let field = UITextField()
            field.isSecureTextEntry = true
            self.addSubview(field)
            field.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
            field.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
            self.layer.superlayer?.addSublayer(field.layer)
            field.layer.sublayers?.first?.addSublayer(self.layer)
        }
    }
}

It looks not working on iOS 17 now. Is there any other solutions?

I've tried the DRM way, but got really bad performance.



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations