In my app i need to restrict the user to take screenshot or screen recording . i used the following code snippet,
let field = UITextField()
let view = UIView(frame: CGRect(x: 0, y: 0, width: field.frame.self.width, height: field.frame.self.height))
// Following view can be customised if required
let newView = UIView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
newView.backgroundColor = .black
field.isSecureTextEntry = true
window.addSubview(field)
view.addSubview(newView)
window.layer.superlayer?.addSublayer(field.layer)
//field.layer.sublayers?.last!.addSublayer(window.layer)
if let lastSublayer = field.layer.sublayers?.last {
lastSublayer.addSublayer(window.layer)
}
field.leftView = view
field.leftViewMode = .always
My query is will below lines meet the Apple compliance? will ther be any rejection while publishing to Appstore?
window.layer.superlayer?.addSublayer(field.layer) field.layer.sublayers?.last!.addSublayer(window.layer).