ScreenshotPreventing-iOS
ScreenshotPreventing-iOS copied to clipboard
Does it work with ios17 beta?
Does it work with ios17 beta? For me, it doesn't work...
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Yes I did. But I didn't use this code. :(
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Yes I did. But I didn't use this code. :(
could you show me your code? you know why it doesn't work
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Yes I did. But I didn't use this code. :(
could you show me your code? you know why it doesn't work
Sure. I'll show you before tomorrow.
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Yes I did. But I didn't use this code. :(
could you show me your code? you know why it doesn't work
extension UIView {
func blockScreenShot() {
DispatchQueue.main.asyc {
let field = UITextField()
field.isSecureTextEntry = true
field.isUserInteractionEnabled = false
self.addSubview(field)
field.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
field.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
field.layer.removeFromSuperlayer()
self.layer.superlayer?.insertSublayer(field.layer, at: 0)
field.layer.sublayers?.last?.addSublayer(self.layer)
}
}
}
You can use it for the view you want to block the screenshot. For example, i applied the code to window's view.
self.window?.blockScreenShot()
- This code might be able to contain typos.
@f-exuan21 i am unable to use i tried to use this in viewdidload
@aerialkoala @f-exuan21 ScreenShield is a similar library that provides a simple way to protect your app's content from being captured or recorded by screenshots and screen recordings, supported in iOS 17 as well. ScreenShield
@f-exuan21 i am unable to use i tried to use this in viewdidload
If you don't set the correct Autolayout, it won't work well. I recommend you check that part.
Does it work with ios17 beta? For me, it doesn't work...
Did you solve it on iOS17
Yes I did. But I didn't use this code. :(
What did you use then??
@yoxisem544, @malt-blue-gen you can try ScreenShield, it's updated and support iOS17