Skip to content

Complete prevention of ios screeen shot #22

Description

@SAHILDEWAN23

Try this - this will restrict the entire window.


func makeSecure(window: UIWindow) {

        let field = UITextField()



        let view = UIView(frame: CGRect(x: 0, y: 0, width: field.frame.self.width, height: field.frame.self.height))



        let image = UIImageView(image: UIImage(named: "whiteImage"))

        image.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)



        field.isSecureTextEntry = true



        window.addSubview(field)

        view.addSubview(image)



        window.layer.superlayer?.addSublayer(field.layer)

        field.layer.sublayers?.last!.addSublayer(window.layer)



        field.leftView = view

        field.leftViewMode = .always

}

I am using expo reactnative will this work on that if i made prebuild and insert this into Appdelegate or there is any different way for that.... will this also get accepted by app store?

Originally posted by @kushal211 in #16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions