Skip to content

A UI component that avoids screenshots and recordings

License

Notifications You must be signed in to change notification settings

MarioIannotta/ShyView

Repository files navigation

ShyView: A UI component that avoids screenshots and recordings

ShyView

SwiftPM 5.3 Version License Platform

Installation

ShyView is available through SwiftPM.

SwiftPM

Add the package to your dependencies

.package(
  name: "ShyView",
  url: "https://github.com/MarioIannotta/ShyView.git",
  .upToNextMinor("0.2.0")
)

Add package product to your targets

.product(
  name: "ShyView",
  package: "ShyView"
)

Pods

ShyView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ShyView'

Usage

Simply Wrap the view you want not to be screenshotted (or recorded) in a ShyView.

let topSecretLabel = UILabel()
topSecretLabel.text = "4, 8, 15, 16, 23, 42"

let shyView = ShyView(topSecretLabel)
view.addSubview(topSecretLabel)
// Configure layout for topSecretLabel

There is also a helper for the implicit content protection

let topSecretLabel = UILabel()
topSecretLabel.text = "4, 8, 15, 16, 23, 42"

view.addSubview(topSecretLabel.privacySensitive())
// Configure layout for topSecretLabel

Or use ShyView as a container for some custom content

let topSecretLabel = UILabel()
topSecretLabel.text = "4, 8, 15, 16, 23, 42"

let shyView = ShyView()
view.addSubview(shyView)
shyView.contentView.addSubview(topSecretLabel)
// Configure layout for shyView, topSecretLabel
// and any other added views independently

Disclaimer

This component, is build upon a UITextField "hack, use it at your own risk.

License

ShyView is available under the MIT license. See the LICENSE file for more info.

Author

@MarioIannotta, info@marioiannotta.com

About

A UI component that avoids screenshots and recordings

Resources

License

Stars

Watchers

Forks

Packages

No packages published