### CocoaPods Installation Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Install ScreenshotPreventing using CocoaPods by adding the appropriate entry to your Podfile. Supports base, RxSwift, and SwiftUI versions. ```ruby pod 'ScreenshotPreventing', '~> 1.4.0' # or pod 'ScreenshotPreventing/RxSwift', '~> 1.4.0' # or SwiftUI pod 'ScreenshotPreventing/SwiftUI', '~> 1.4.0' ``` -------------------------------- ### UIKit Usage with Delayed Content View Setup Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Initialize ScreenshotPreventingView without a content view and set it up later using the setup(contentView:) method. ```swift import UIKit import ScreenshotPreventing class ViewController: UIViewController { let stack = UIStackView() let container = ScreenshotPreventingView() override func viewDidLoad() { super.viewDidLoad() // add to subview here. container.setup(contentView: stack) } } ``` -------------------------------- ### Swift Package Manager Installation Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Integrate ScreenshotPreventing into your Xcode project using Swift Package Manager by adding the package URL to your Package.swift file. ```swift dependencies: [ .package(url: "https://github.com/yoxisem544/ScreenshotPreventing.git", .upToNextMajor(from: "1.4.0")) ] ``` -------------------------------- ### UIKit Usage with Initial Content View Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Wrap a UIStackView inside ScreenshotPreventingView to prevent screenshots. The content view is provided during initialization. ```swift import UIKit import ScreenshotPreventing class ViewController: UIViewController { let stack = UIStackView() let container = ScreenshotPreventingView(contentView: stack) override func viewDidLoad() { super.viewDidLoad() // add to subview here. } } ``` -------------------------------- ### RxSwift Binding for Screenshot Prevention Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Use the Rx extension to drive the preventScreenCapture property of ScreenshotPreventingView with an Observable. Requires the RxScreenshotPreventing package. ```swift whetherOrNotToPreventScreenshotObservable .bind(to: screenshotPreventingView.rx.preventScreenCapture) .disposed(by: bag) ``` -------------------------------- ### SwiftUI Usage with ScreenshotPrevent View Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Wrap a SwiftUI view within ScreenshotPrevent, using a binding to control whether screenshot prevention is active. ```swift import SwiftUI import ScreenshotPreventingSwiftUI struct ContentView: View { @State private var preventScreenshot = false var body: some View { ScreenshotPrevent(isProtected: preventScreenshot) { Text("Hello") .padding() .background(Color.yellow) .cornerRadius(12) } } } ``` -------------------------------- ### SwiftUI Usage with View Modifier Source: https://github.com/yoxisem544/screenshotpreventing-ios/blob/main/README.md Apply screenshot protection to a SwiftUI view using the screenshotProtected view modifier extension, controlled by a binding. ```swift import SwiftUI import ScreenshotPreventingSwiftUI struct ContentView: View { @State private var preventScreenshot = false var body: some View { Text("Hello") .padding() .background(Color.yellow) .cornerRadius(12) .screenshotProtected(isProtected: preventScreenshot) } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.