{"id":13462735,"url":"https://github.com/yoxisem544/ScreenshotPreventing-iOS","last_synced_at":"2025-03-25T05:32:14.796Z","repository":{"id":57646391,"uuid":"525639591","full_name":"yoxisem544/ScreenshotPreventing-iOS","owner":"yoxisem544","description":"Prevent screenshot or screenrecording on iOS devices","archived":false,"fork":false,"pushed_at":"2024-02-18T17:17:42.000Z","size":3880,"stargazers_count":366,"open_issues_count":8,"forks_count":35,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-01T14:46:35.491Z","etag":null,"topics":["cocoapods","ios","ios-lib","screencapture","screenrecord","screenrecording","screenshot","security","spm","swift","swiftpackage","swiftpm","swiftui","uikit","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoxisem544.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-17T04:32:14.000Z","updated_at":"2025-02-18T18:18:35.000Z","dependencies_parsed_at":"2024-01-16T05:11:45.727Z","dependency_job_id":"e0cd3af5-9451-4dc5-83ec-29eac5bac476","html_url":"https://github.com/yoxisem544/ScreenshotPreventing-iOS","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"79e135bec19c5a894db716849e721f2f3c50d40c"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoxisem544%2FScreenshotPreventing-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoxisem544%2FScreenshotPreventing-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoxisem544%2FScreenshotPreventing-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoxisem544%2FScreenshotPreventing-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoxisem544","download_url":"https://codeload.github.com/yoxisem544/ScreenshotPreventing-iOS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407577,"owners_count":20610227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","ios","ios-lib","screencapture","screenrecord","screenrecording","screenshot","security","spm","swift","swiftpackage","swiftpm","swiftui","uikit","xcode"],"created_at":"2024-07-31T13:00:19.884Z","updated_at":"2025-03-25T05:32:14.333Z","avatar_url":"https://github.com/yoxisem544.png","language":"Swift","funding_links":[],"categories":["This project is aiming to list the most needed and awesome pods lib for iOS projects","screenshot or screenrecording"],"sub_categories":[],"readme":"# ScreenshotPreventing\n\nA simple wrapper view that is able to prevent screenshot or screen recording on iOS.\n\n## Requirement\n\niOS 12+.\n\nSwiftUI will need iOS 13+.\n\n## Installation\n\n### Swift Package Manager\n\n[Swift Package Manager](https://swift.org/package-manager/) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\n\u003e Xcode 11+ is required to build ScreenshotPreventing using Swift Package Manager.\n\nTo integrate ScreenshotPreventing into your Xcode project using Swift Package Manager, add it to the dependencies value of your `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/yoxisem544/ScreenshotPreventing.git\", .upToNextMajor(from: \"1.4.0\"))\n]\n```\n\n### CocoaPods\n\nFor ScreenshotPreventing, use the following entry in your Podfile:\n\n```ruby\npod 'ScreenshotPreventing', '~\u003e 1.4.0'\n# or \npod 'ScreenshotPreventing/RxSwift', '~\u003e 1.4.0'\n# or SwiftUI\npod 'ScreenshotPreventing/SwiftUI', '~\u003e 1.4.0'\n```\n\n## Demo Project\n\nClone this project, then\n\n```shell\ncd ScreenshotPreventing\n# For normal demo\nopen Demo/Demo.xcodeproj\n# For SwiftUI demo\nopen Demo-SwiftUI/Demo-SwiftUI.xcodeproj\n```\n\nThen build for any iOS simulator to test this out.\n\nBy triggering screenshot on simulator, look for `Simulator \u003e Device \u003e Trigger Screenshot`.\n\n\u003cimg src=\"./Assets/demo.gif\" width=\"470\" /\u003e\n\n## Example\n\nYou can wrap view you don't want to be screenshot inside `ScreenshotPreventingView`\n\n```swift\nimport UIKit\nimport ScreenshotPreventing\n\nclass ViewController: UIViewController {\n\n    let stack = UIStackView()\n    let container = ScreenshotPreventingView(contentView: stack)\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        // add to subview here.\n    }\n}\n```\n\nOr you can setup content view later.\n\n```swift\nimport UIKit\nimport ScreenshotPreventing\n\nclass ViewController: UIViewController {\n\n    let stack = UIStackView()\n    let container = ScreenshotPreventingView()\n\n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        // add to subview here.\n        container.setup(contentView: stack)\n    }\n}\n```\n\n## SwiftUI Usage\n\nSimply wrap your view inside `ScreenshotPrevent` View. \nYou should pass in a isProtected binding to toggle on whether to prevent screenshot or not.\n\n```swift\nimport SwiftUI\nimport ScreenshotPreventingSwiftUI\n\nstruct ContentView: View {\n\n    @State private var preventScreenshot = false\n\n    var body: some View {\n        ScreenshotPrevent(isProtected: preventScreenshot) {\n            Text(\"Hello\")\n                .padding()\n                .background(Color.yellow)\n                .cornerRadius(12)\n        }\n    }\n}\n```\n\nor using view modifier extension\n\n```swift\nimport SwiftUI\nimport ScreenshotPreventingSwiftUI\n\nstruct ContentView: View {\n\n    @State private var preventScreenshot = false\n\n    var body: some View {\n        Text(\"Hello\")\n            .padding()\n            .background(Color.yellow)\n            .cornerRadius(12)\n            .screenshotProtected(isProtected: preventScreenshot)\n    }\n}\n```\n\n## RxSwift Extension\n\nIf you use RxSwift in your project, there is a Rx extension to drive `preventScreenCapture` property on `ScreenshotPreventingView`.\n\nUse `RxScreenshotPreventing` package for this extension.\n\n```swift\nwhetherOrNotToPreventScreenshotObservable\n    .bind(to: screenshotPreventingView.rx.preventScreenCapture)\n    .disposed(by: bag)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoxisem544%2FScreenshotPreventing-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoxisem544%2FScreenshotPreventing-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoxisem544%2FScreenshotPreventing-iOS/lists"}