Skip to content

Cleanup code comments and add wkwebview example - #367

Merged
alexanderdibenedetto merged 2 commits into
v4-0-0from
chore/cleanup-code-comments-and-add-wkwebview-example
Oct 19, 2026
Merged

alexanderdibenedetto merged 2 commits into
v4-0-0from
chore/cleanup-code-comments-and-add-wkwebview-example

Conversation

@alexanderdibenedetto

Copy link
Copy Markdown
Contributor
  • 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.

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
alexanderdibenedetto changed the base branch from master to v4-0-0 October 19, 2026 18:13
@alexanderdibenedetto
alexanderdibenedetto marked this pull request as ready for review October 19, 2026 18:16
@alexanderdibenedetto alexanderdibenedetto added this to the 4.0.0 milestone Oct 19, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to TSKTrustEvaluationFailedUserDefinedTrustAnchor and kTSKIgnorePinningForUserDefinedTrustAnchors is 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.

Comment thread TrustKitDemo/TrustKitDemo-ObjC/WebViewController.m

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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

Comment thread TrustKitDemo/TrustKitDemo-Swift/WebViewController.swift Outdated
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.
@alexanderdibenedetto
alexanderdibenedetto merged commit c403702 into v4-0-0 Oct 19, 2026
10 checks passed
@alexanderdibenedetto
alexanderdibenedetto deleted the chore/cleanup-code-comments-and-add-wkwebview-example branch October 20, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants