{"id":28388853,"url":"https://github.com/igooor-bb/greedykit","last_synced_at":"2025-07-08T17:35:39.460Z","repository":{"id":58891625,"uuid":"532551099","full_name":"igooor-bb/GreedyKit","owner":"igooor-bb","description":"Components written in Swift for preventing sensitive media data to be captured","archived":false,"fork":false,"pushed_at":"2025-07-06T20:55:47.000Z","size":5296,"stargazers_count":22,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-06T21:39:16.286Z","etag":null,"topics":["capture-screen","cocoapods","components","image","ios","pacakge","screenshot","swift","swift-package-manager","swiftui","video"],"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/igooor-bb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-09-04T13:38:09.000Z","updated_at":"2025-07-04T17:05:02.000Z","dependencies_parsed_at":"2025-07-06T21:31:33.102Z","dependency_job_id":"06d51bde-0ea0-4e81-ba12-bac19676bb84","html_url":"https://github.com/igooor-bb/GreedyKit","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/igooor-bb/GreedyKit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igooor-bb%2FGreedyKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igooor-bb%2FGreedyKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igooor-bb%2FGreedyKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igooor-bb%2FGreedyKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igooor-bb","download_url":"https://codeload.github.com/igooor-bb/GreedyKit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igooor-bb%2FGreedyKit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264315038,"owners_count":23589699,"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":["capture-screen","cocoapods","components","image","ios","pacakge","screenshot","swift","swift-package-manager","swiftui","video"],"created_at":"2025-05-30T23:16:21.746Z","updated_at":"2025-07-08T17:35:39.455Z","avatar_url":"https://github.com/igooor-bb.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GreedyKit\n\nGreedyKit is a set of ready-to-use UIKit and SwiftUI components to prevent sensitive media data, such as images or videos, from being exposed by screen capture tools on iOS.\n\n## Contents\n\n- [Contents](#contents)\n- [Motivation](#motivation)\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [Swift Package Manager](#swift-package-manager)\n    - [Xcode](#xcode)\n    - [Package manifest](#package-manifest)\n- [Usage](#usage)\n  - [Image](#image)\n  - [Video](#video)\n- [Contribution](#contribution)\n- [License](#license)\n\n## Motivation\n\nWhile building a video player for one of the enterprise projects, I needed a way to prevent users from taking screenshots or recording what was on the screen. [Apple’s FairPlay DRM](https://developer.apple.com/streaming/fps/) secures streamed media only, so I turned to [AVSampleBufferDisplayLayer](https://developer.apple.com/documentation/avfoundation/avsamplebufferdisplaylayer), which natively supports what I needed.\n\nGreedyKit packages this technique, allowing you to protect media with a single property toggle without DRM servers or certificates.\n\n## Requirements\n\n- iOS/iPadOS 13.0 and later\n- Xcode 16.0 and later\n\n## Installation\n\n### Swift Package Manager\n\n#### Xcode\n\nYou can use Swift Package Manager to install GreedyKit using Xcode:\n\n1. Open your project in Xcode\n2. Open \"File\" -\u003e \"Add Packages...\"\n3. Paste the repository URL: \u003chttps://github.com/igooor-bb/GreedyKit\u003e\n4. Click \"Next\" a couple of times and finish the process\n\n#### Package manifest\n\nAlternatively, add the dependency to your `Package.swift`:\n\n```swift\n.package(url: \"https://github.com/igooor-bb/GreedyKit\", from: \"\u003cversion\u003e\")\n```\n\n## Usage\n\nAfter you have installed the package, import it into the project in the usual way:\n\n```swift\nimport GreedyKit\n```\n\nThe package includes components for displaying images and videos that can change the capture mode on demand.\n\nYou can find an example of how to use them in [Examples/GreedyKitExample](Examples/GreedyKitExample/).\n\n### Image\n\nIn UIKit, you can use the `GreedyImageView` wrapper around your `UIImage` similar to regular `UIImageView`:\n\n```swift\nlet imageView = GreedyImageView()\nimageView.image = UIImage(named: \"SecretImage\")\n\n// Block capture at any time:\nimageView.preventsCapture = true\n```\n\nIn SwiftUI, you can simply use `GreedyImage` compononent with your `UIImage` inside:\n\n```swift\nVStack {\n    GreedyImage(uiImage, preventsCapture: true)\n}\n```\n\n### Video\n\nIn UIKit, you can use the `GreedyPlayerView` wrapper around your `AVPlayer`:\n\n```swift\nlet player = AVPlayer(url: videoURL)\nlet playerView = GreedyPlayerView()\nplayerView.player = player\n\n// Start playback:\nplayer.play()\n\n// Block capture at any time:\nplayerView.preventsCapture = true\n```\n\nIn SwiftUI, you just need to create a `GreedyPlayer` within your view hierarchy and pass an `AVPlayer`, whose content it will draw:\n\n```swift\nVStack {\n    GreedyPlayer(player: avPlayer, preventsCapture: true)\n}\n```\n\n## Contribution\n\nTo contribute, use the follow \"fork-and-pull\" git workflow:\n\n1. Fork the repository on github\n2. Clone the project to your own machine\n3. Commit changes to your own branch\n4. Push your work back up to your fork\n5. Submit a pull request so that I can review your changes\n\n*NOTE: Be sure to merge the latest from \"upstream\" before making a pull request!*\n\n## License\n\n**GreedyKit** is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figooor-bb%2Fgreedykit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figooor-bb%2Fgreedykit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figooor-bb%2Fgreedykit/lists"}