This is the simplest example of utilizing the ScreenshotPreventing-iOS library to prevent screenshots on iOS in a SwiftUI app.
-
Clone this repository
-
Fetch the Swift Package Manager dependencies
-
Build and run the sample app
This example uses ScreenshotPreventing-iOS API with just one line of code: in
ContentView.swift the line responsible for screenshot protection is:
.screenshotProtected(isProtected: preventScreenshot)