JayantBadlani / ScreenShield

ScreenShield is an iOS library that provides a simple way to protect your app's content from being captured or recorded by screenshots, screen recordings, or other screen capture methods. It works by adding a secure layer on top of your views, which prevents most screen capture mechanisms from recording the underlying content.
MIT License
89 stars 15 forks source link

Layout is messed up when using in XIB. #1

Closed LYluyu closed 7 months ago

LYluyu commented 11 months ago

When my controller is loaded using XIB, the layout appears incorrect.

https://github.com/JayantBadlani/ScreenShield/assets/16254669/1776358c-a6c1-41e4-a899-aed881d9bc07

JayantBadlani commented 11 months ago

Hello @LYluyu ,

Preventing screen capture in an iOS app is challenging because it's not directly supported by the iOS operating system. In this library, we have customised our code and applied some hacks/workarounds to achieve the desired result. The issue of a messed-up UI is a known problem.

To address the layout issue, consider adding "ScreenShield" protection to your view after the UI finishes loading. Applying "ScreenShield" protection in the viewDidAppear method can help mitigate layout problems.