Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

This package adds a modifier to your SwiftUI elements to prevent screenshots. This is useful for apps that display sensitive information and want to prevent users from taking screenshots.

License

Notifications You must be signed in to change notification settings

0xWDG/PreventScreenshot

Open more actions menu

Repository files navigation

PreventScreenshot

This package adds a modifier to your SwiftUI elements to prevent screenshots. This is useful for apps that display sensitive information and want to prevent users from taking screenshots.

Swift Package Manager License

Requirements

  • Swift 5.9+ (Xcode 15+)
  • iOS 13+, macOS 10.15+, tvOS 15+, visionOS 1+

Installation (Pakage.swift)

dependencies: [
    .package(url: "https://github.com/0xWDG/PreventScreenshot.git", branch: "main"),
],
targets: [
    .target(name: "MyTarget", dependencies: [
        .product(name: "PreventScreenshot", package: "PreventScreenshot"),
    ]),
]

Installation (Xcode)

  1. In Xcode, open your project and navigate to FileSwift PackagesAdd Package Dependency...
  2. Paste the repository URL (https://github.com/0xWDG/PreventScreenshot) and click Next.
  3. Click Finish.

Usage

Example to read a ImageView (Multi platform):

import SwiftUI
import PreventScreenshot

struct ContentView: View {
    var body: some View {
        VStack {
            Text("Don't take a screenshot of this")
                .preventScreenshot()
        }
        .padding()
    }
}

Contact

🦋 @0xWDG 🐘 mastodon.social/@0xWDG 🐦 @0xWDG 🧵 @0xWDG 🌐 wesleydegroot.nl 🤖 Discord

About

This package adds a modifier to your SwiftUI elements to prevent screenshots. This is useful for apps that display sensitive information and want to prevent users from taking screenshots.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 
Morty Proxy This is a proxified and sanitized view of the page, visit original site.