markiv/swiftui-unscreenshottable
Protect sensitive content on iOS.
Usage
You can apply the protected modifier to your top-level view, typically ContentView:
import SwiftUI
import Unscreenshottable
@main
struct UnscreenshottableDemoApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.protected {
Text("No screenshots nor screen sharing, please.")
}
}
}
}Protection Options
The .protected modifier can take an optional parameter if you want to limit the protection types (the default is all three). You can even combine multiple protections:
ContentView()
.protected(from: inactivity) {
Image("logo")
}
.protected(from: [.screenshots, .screenSharing]) {
Text("No screenshots nor screen sharing, please.")
}Installation
Swift Package Manager
Use the package URL or search for the SwiftUI-Unscreenshottable package: https://github.com/markiv/SwiftUI-Unscreenshottable.git.
For how to integrate package dependencies refer to the Adding Package Dependencies to Your App documentation.
Package Metadata
Repository: markiv/swiftui-unscreenshottable
Default branch: main
README: README.md