Repository navigation
Cleanup code comments and add wkwebview example - #367
Merged
alexanderdibenedetto merged 2 commits intoOct 19, 2026
Merged
alexanderdibenedetto merged 2 commits into
alexanderdibenedetto merged 2 commits into
Conversation
Move both Xcode projects to the current file format (objectVersion 77) and apply Xcode 27's recommended settings to the demo project. Mark the two macOS-only symbols API_UNAVAILABLE instead of NS_AVAILABLE_MAC(10_9), drop the always-true OS version check in the reporter, and remove or correct comments that described code paths for OS versions TrustKit no longer supports. Replace the UIWebView section of the getting started guide with a WKWebView example that validates off the main thread, and add that example to both demos with UI tests for a pinned page that loads and one that is blocked.
alexanderdibenedetto
marked this pull request as ready for review
October 19, 2026 18:16
There was a problem hiding this comment.
Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.
Besides the inline finding, I checked two more things and found no problem in either:
- The new
API_UNAVAILABLE(ios, tvos, watchos, visionos)markings: every reference toTSKTrustEvaluationFailedUserDefinedTrustAnchorandkTSKIgnorePinningForUserDefinedTrustAnchorsis already inside#if !TARGET_OS_IPHONE. That covers TrustKit.m, TSKPinningValidator.m, parse_configuration.m and TSKReporterTests.m, so iOS and Mac Catalyst builds still compile. - The removed nil check in TSKBackgroundReporter.m: nothing earlier in the init sets
_appPlatformVersion, so the behavior is the same as before.
Extended reasoning...
One demo-app nit was reported inline. I also checked the library-side availability changes and the reporter change, and neither has a problem.
There was a problem hiding this comment.
🔵 Needs a closer look
WebKit authentication changes need cancellation-handling corrections and Apple-platform validation before final human approval.
1 open issue
What changed in this PR
Modernizes TrustKit’s project settings and platform guidance, and adds WKWebView pinning examples to both demos.
Changes:
- Updates Xcode project formats and demo build settings.
- Adds Swift and Objective-C web-view examples with UI tests.
- Clarifies platform availability and removes obsolete comments.
| File | Description |
|---|---|
| TrustKitDemo/TrustKitDemoUITests/TrustKitDemoUITests.swift | Adds web-view tests and stable button selectors. |
| TrustKitDemo/TrustKitDemo.xcodeproj/xcshareddata/xcschemes/TrustKitDemo-Swift.xcscheme | Updates upgrade metadata. |
| TrustKitDemo/TrustKitDemo.xcodeproj/xcshareddata/xcschemes/TrustKitDemo-ObjC.xcscheme | Updates upgrade metadata. |
| TrustKitDemo/TrustKitDemo.xcodeproj/project.pbxproj | Modernizes settings and registers web-view sources. |
| TrustKitDemo/TrustKitDemo-Swift/WebViewController.swift | Adds Swift WKWebView pinning example. |
| TrustKitDemo/TrustKitDemo-Swift/Main.storyboard | Adds web-view controls and test identifiers. |
| TrustKitDemo/TrustKitDemo-Swift/DTViewController.swift | Connects web-view demo actions. |
| TrustKitDemo/TrustKitDemo-ObjC/WebViewController.m | Adds Objective-C WKWebView pinning example. |
| TrustKitDemo/TrustKitDemo-ObjC/WebViewController.h | Declares the web-view controller. |
| TrustKitDemo/TrustKitDemo-ObjC/ViewController.m | Connects web-view demo actions. |
| TrustKitDemo/TrustKitDemo-ObjC/ViewController.h | Adds web-view button outlets. |
| TrustKitDemo/TrustKitDemo-ObjC/Base.lproj/Main.storyboard | Adds web-view controls and test identifiers. |
| TrustKit/Reporting/TSKPinFailureReport.m | Corrects date-formatting comments. |
| TrustKit/Reporting/TSKBackgroundReporter.m | Removes redundant OS-version guard. |
| TrustKit/public/TrustKit/TSKTrustKitConfig.h | Clarifies macOS-only configuration availability. |
| TrustKit/public/TrustKit/TSKTrustDecision.h | Updates availability annotations and comments. |
| TrustKit/Pinning/TSKSPKIHashCache.m | Removes obsolete platform-version heading. |
| TrustKit/Pinning/ssl_pin_verifier.m | Updates macOS terminology in comments. |
| TrustKit/Pinning/pinning_utils.h | Removes outdated API fallback descriptions. |
| TrustKit/parse_configuration.m | Updates macOS terminology in a comment. |
| TrustKit.xcodeproj/project.pbxproj | Updates project format. |
| docs/getting-started.md | Replaces legacy guidance with WKWebView examples. |
Review effort: Balanced
Record the host whenever TrustKit cancels a challenge and show Blocked only for failed navigations to that host, naming the failing URL. Other cancelled navigations, such as an interrupted page load, no longer show an alert.
EthanArbuckle
approved these changes
Oct 19, 2026
alexanderdibenedetto
deleted the
chore/cleanup-code-comments-and-add-wkwebview-example
branch
October 20, 2026 00:19
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

longer supports.