Skip to content

Commit 2f964d2

Browse files
committed
Improved DocC documentation
1 parent 2a349b2 commit 2f964d2

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# NukeSensitivity
2-
iOS 17 Sensitive Content Analysis integration for [Nuke](https://github.com/kean/Nuke) written in swift.
3-
4-
NukeSensitivity makes it easy to detect and obscure sensitive content in images loaded and displayed with NukeUI.
2+
iOS 17 Sensitive Content Analysis integration for [Nuke](https://github.com/kean/Nuke) written in swift. NukeSensitivity makes it easy to detect and obscure sensitive content in images loaded and displayed with NukeUI.
53

64
## Overview
75
Starting in iOS 17.0 and macOS 14.0, Apple provides a [Sensitive Content Analysis framework](https://developer.apple.com/documentation/sensitivecontentanalysis) for use in applications where users may want to hide potentially sensitive images and video. This library bridges Nuke -- the asynchronous image loading library -- and Apple's framework to make it easy to obfuscate content for users who opt-in.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# App Integration and Testing
2+
3+
Configure your application entitlements and test devices to work with Sensitive Content Analysis.
4+
5+
## Overview
6+
7+
To properly use Apple's Sensitive Content Analysis framework, your application must include a special entitlement allowing it to call the system framework. Improper configuration by your application will result in the framework reporting that content analysis is `disabled`, whether it is or not, and rejecting any analysis requests.
8+
9+
Once the entitlement is added, your application becomes eligible to participate in sensitive content analysis. However, users maintain control over which applications have permission to do so.
10+
11+
To test analysis works as intended in your application, you'll need to do some additional setup as well.
12+
13+
### Add the entitlement
14+
15+
In Xcode, add `com.apple.developer.sensitivecontentanalysis.client` to your application's entitlements.
16+
17+
### Testing your application
18+
19+
1. Download the [testing profile from Apple](https://developer.apple.com/documentation/sensitivecontentanalysis/testing-your-app-s-response-to-sensitive-media#Install-the-test-profile) and install it on your test device. Once installed, the profile is valid for a period of three days. You'll need to download and re-install the profile if you need additional time for testing.
20+
2. Pass `true` to the ``SensitiveContentShim/init(useFalsePositiveForDebug:)`` initializer in ``SensitiveContentShim``. When your app's `DEBUG` flag is set this will cause ``SensitiveContentShim`` to analyze the Apple-provided false-positive QR code instead of the provided image content. In configurations of your application where `DEBUG` is not set, this flag has no effect.
21+
3. Enable Sensitive Content Analysis in your device's Privacy settings.
22+
4. On the next run of your application, all images loaded with a ``SensitiveContentShim`` whose `useFalsePositiveForDebug` property set to `true` should be obscured. If this is not the case, check that you've set up your entitlements and testing profile correctly and that Sensitive Content Analysis is enabled specifically for your app.

Sources/NukeSensitivity/Documentation.docc/Documentation.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ When a user who has opted-in to Sensitive Content Analysis (or has it enabled on
1010

1111
Before using this library, you'll need to do some additional setup in your application. Please read the <doc:GettingStarted> document to learn more.
1212

13-
## Comaptibility
13+
## Compatibility
1414
This library is compatible in projects targeting iOS 16 / macOS 13 and later. However, the Sensitive Content Analysis framework is only available on iOS 17.0 and macOS 14.0 and later. Use of the sensitive `LazyImage` initializers, `sensitiveOverlay`, and `SensitiveContentShim` have no effect on iOS / macOS versions prior to 17.0 / 14.0.
1515

1616
## Topics
1717

18+
### Setup, Integration, and Testing
19+
20+
- <doc:GettingStarted>
21+
- <doc:AppIntegration>
22+
1823
### Loading Sensitive LazyImages
1924

2025
- ``NukeUI/LazyImage/init(url:sensitiveContentShim:)``

0 commit comments

Comments
 (0)