Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.84 KB

README.md

File metadata and controls

58 lines (37 loc) · 1.84 KB

ScreenShieldKit

A Swift framework to hide UIView/NSView/CALayer from being captured when taking screenshots.

Overview

Workflow Status
iOS UI Tests iOS UI Tests

Demo

Getting Started

In your Package.swift file, add the following dependency to your dependencies argument:

.package(url: "https://github.com/Kyle-Ye/ScreenShieldKit.git", from: "0.1.0"),

Then add the dependency to any targets you've declared in your manifest:

.target(
    name: "MyTarget", 
    dependencies: [
        .product(name: "ScreenShieldKit", package: "ScreenShieldKit"),
    ]
),

Usage

Instead of wrapping your view in a secure UITextField or ScreenShieldView,

you can just directly call the hideFromCapture(hidden:) API on your view or layer.

import ScreenShieldKit

let view = UIView(frame: .zero)
view.hideFromCapture(hidden: true)

// Resture the behavior
view.hideFromCapture(hidden: false)

Detailed documentation for ScreenShieldKit can be found on the Swift Package Index.

License

See LICENSE file - MIT

Credits

https://nsantoine.dev/posts/CALayerCaptureHiding