https://github.com/kovs705/accessdenied
Small, bite-sized library to hide sensitive views
https://github.com/kovs705/accessdenied
Last synced: about 1 year ago
JSON representation
Small, bite-sized library to hide sensitive views
- Host: GitHub
- URL: https://github.com/kovs705/accessdenied
- Owner: kovs705
- License: mit
- Created: 2025-05-25T17:08:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-07T16:14:09.000Z (about 1 year ago)
- Last Synced: 2025-06-07T16:29:07.503Z (about 1 year ago)
- Language: Swift
- Size: 196 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AccessDenied
Library to hide sensitive views
Compatible with iOS 15.0 and later
# AccessDenied
A SwiftUI library that helps protect sensitive content in your iOS apps by automatically hiding content when the app goes to the background or when a screenshot is taken.
## Features
- Multiple privacy styles to choose from:
- Default
- Redacted
- Blur
- Opacity
- Custom (with customizable color and corner radius)
- Automatic content protection when app goes to background
- Easy to use SwiftUI view modifier
- iOS 15+ support
## Installation
### Swift Package Manager
Add the following dependency to your `Package.swift` file:
```swift
dependencies: [
.package(url: "https://github.com/kovs705/AccessDenied.git", from: "1.0.0")
]
```
Or add it directly in Xcode:
1. Go to File > Add Packages
2. Enter the repository URL: `https://github.com/kovs705/AccessDenied.git`
3. Click Add Package
## Usage
Simply add the `privacySensitive` modifier to any view you want to protect:
```swift
import SwiftUI
import AccessDenied
struct ContentView: View {
var body: some View {
Text("Sensitive Content")
.privacySensitive(.blur)
}
}
```
### Available Styles
```swift
// Default style
.privacySensitive(.default)
// Redacted style
.privacySensitive(.redacted)
// Blur style
.privacySensitive(.blur)
// Opacity style
.privacySensitive(.opacity)
// Custom style with color and corner radius
.privacySensitive(.custom(color: .black, cornerRadius: 10))
// Disable privacy protection
.privacySensitive(.default, isEnabled: false)
```
## Requirements
- iOS 15.0+
- Swift 5.9
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Support
If you encounter any issues or have questions:
1. Check the [Issues](https://github.com/kovs705/AccessDenied/issues) page
2. Create a new issue with detailed information
3. Include device model, iOS version, and code samples