Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot blocking not working if contentView is provided using setup(:_) method #18

Open
kirti-swiggy opened this issue Feb 18, 2024 · 0 comments · May be fixed by #19
Open

Screenshot blocking not working if contentView is provided using setup(:_) method #18

kirti-swiggy opened this issue Feb 18, 2024 · 0 comments · May be fixed by #19

Comments

@kirti-swiggy
Copy link

kirti-swiggy commented Feb 18, 2024

If the contentView is not provided in init(:_) and rather lazily given using setup(contentView: UIView) method, screenshot blocking doesn't work.

The reason is preventScreenCapture variable doesn't get set in this scenario. We prematurely exit out of the setupUI() function if contentView is nil. Therefore, the below block never gets called.

DispatchQueue.main.async {
    self.preventScreenCapture = true
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant