Skip to content

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

@kirti-swiggy

Description

@kirti-swiggy

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
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions