Swiftpack.co - Stampoo/SnapshotSafeView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Stampoo.
Stampoo/SnapshotSafeView 0.0.3
Used for hide view from system screenshots and video recording
⭐️ 5
🕓 1 week ago
iOS
.package(url: "https://github.com/Stampoo/SnapshotSafeView.git", from: "0.0.3")

SnapshotSafeView

Used for hide view from system screenshots and video recording.

Requirements

  • Xcode version: 12.5.1 or higher
  • Deployment target iOS v12 or higher
  • Swift toolchain 5.5

What working:

  • Autolayout
  • Position inside content with autolayout
  • Hide content inside protected view
  • Dinamicaly enable/disable hiding
  • Provide gestures

In progress:

  • Dinamicaly enable/disable hiding from system screenshots and videorecordings(disabling not working yet) Done
  • Run from init(coder:)
  • position inside content with autolayout(now frame based only) Done
  • Improve API

How usage:

final class ExampleViewController: UIViewController {

    var hiddenFromScreenshotButtonController = ScreenshotProtectController(content: UIButton())

    override func viewDidLoad() {
        super.viewDidLoad()
        hiddenFromScreenshotButtonController.content.backgroundColor = .systemRed // UI customization apply to content
        hiddenFromScreenshotButtonController.content.layer.cornerRadius = 20

        view.addSubview(hiddenFromScreenshotButtonController.container)
        hiddenFromScreenshotButtonController.container.translatesAutoresizingMaskIntoConstraints = false

        [
            hiddenFromScreenshotButtonController.container.topAnchor.constraint(equalTo: view.topAnchor, constant: 65),
            hiddenFromScreenshotButtonController.container.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 65),
            hiddenFromScreenshotButtonController.container.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -65),
            hiddenFromScreenshotButtonController.container.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -65)
        ].forEach { $0.isActive = true } // Layout control apply to container

        hiddenFromScreenshotButtonController.setupContentAsHiddenInScreenshotMode() // apply hidden mode
        // content will be removed from system screenshots and screen recording
    }

}

Example:

GitHub

link
Stars: 5
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics