Value of type 'ScreenshotInvincibleContainerProtocol' has no member 'position'
MallikarjunH opened this issue · 2 comments
MallikarjunH commented
Stampoo commented
Hi @MallikarjunH, this just little wrapper for NSLayoutAnchor API
, https://github.com/Stampoo/WrappingAnchor.
U can use this same way 🙂:
final class ExampleViewController: UIViewController {
var hiddenFromScreenshotButtonController = ScreenshotProtectController(content: UIButton())
override func viewDidLoad() {
super.viewDidLoad()
hiddenFromScreenshotButtonController.content.backgroundColor = .systemRed // UI customization apply to content
hiddenFromScreenshotButtonController.content.layer.cornerRadius = 20
view.addSubview(hiddenFromScreenshotButtonController.container)
/// Instead wrapper
hiddenFromScreenshotButtonController.container.translatesAutoresizingMaskIntoConstraints = false
[
hiddenFromScreenshotButtonController.container.topAnchor.constraint(equalTo: view.topAnchor, constant: 80),
hiddenFromScreenshotButtonController.container.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 20),
hiddenFromScreenshotButtonController.container.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -20),
hiddenFromScreenshotButtonController.container.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -80)
].forEach { $0.isActive = true } // Layout control apply to container
hiddenFromScreenshotButtonController.setupContentAsHiddenInScreenshotMode() // apply hidden mode
// content will be removed from system screenshots and screen recording
}
}
MallikarjunH commented
Working fine. Thanks for the update.