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 (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-13T12:53:52.000Z (7 months ago)
- Last Synced: 2025-02-04T21:44:43.015Z (4 months ago)
- Topics: 0xwdg, hacktoberfest, prevent, screenshot, screenshot-prevent, spm, swift, swiftlang, swiftui
- Language: Swift
- Homepage: https://0xwdg.github.io/PreventScreenshot/
- Size: 305 KB
- Stars: 3
- 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 PreventScreenshotstruct ContentView: View {
var body: some View {
VStack {
Text("Don't take a screenshot of this")
.preventScreenshot()
}
.padding()
}
}
```## Contact
We can get in touch via [Twitter/X](https://twitter.com/0xWDG), [Discord](https://discordapp.com/users/918438083861573692), [Mastodon](https://mastodon.social/@0xWDG), [Email](mailto:[email protected]), [Website](https://wesleydegroot.nl).