ShyView is available through 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"
)
ShyView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ShyView'
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
This component, is build upon a UITextField "hack, use it at your own risk.
ShyView is available under the MIT license. See the LICENSE file for more info.