https://github.com/0xwdg/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.
https://github.com/0xwdg/preventscreenshot
0xwdg hacktoberfest prevent screenshot screenshot-prevent spm swift swiftlang swiftui
Last synced: 4 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/0xwdg/preventscreenshot
- Owner: 0xWDG
- License: mit
- Created: 2024-07-23T18:59:33.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-20T20:13:45.000Z (over 1 year ago)
- Last Synced: 2026-01-30T03:39:59.584Z (5 months ago)
- Topics: 0xwdg, hacktoberfest, prevent, screenshot, screenshot-prevent, spm, swift, swiftlang, swiftui
- Language: Swift
- Homepage: https://0xwdg.github.io/PreventScreenshot/
- Size: 307 KB
- Stars: 12
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
[](https://swiftpackageindex.com/0xWDG/PreventScreenshot)
[](https://swiftpackageindex.com/0xWDG/PreventScreenshot)
[](https://swift.org/package-manager)

## Requirements
- Swift 5.9+ (Xcode 15+)
- iOS 13+, macOS 10.15+, tvOS 15+, visionOS 1+
## Installation (Pakage.swift)
```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 **File** โ **Swift Packages** โ **Add 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):
```swift
import SwiftUI
import PreventScreenshot
struct ContentView: View {
var body: some View {
VStack {
Text("Don't take a screenshot of this")
.preventScreenshot()
}
.padding()
}
}
```
## Contact
๐ฆ [@0xWDG](https://bsky.app/profile/0xWDG.bsky.social)
๐ [mastodon.social/@0xWDG](https://mastodon.social/@0xWDG)
๐ฆ [@0xWDG](https://x.com/0xWDG)
๐งต [@0xWDG](https://www.threads.net/@0xWDG)
๐ [wesleydegroot.nl](https://wesleydegroot.nl)
๐ค [Discord](https://discordapp.com/users/918438083861573692)