Use auto-swizzling for simple Apps
masterFor simple applications, you can deploy TrustKit without modifying source code by using auto-swizzling.
- Add configuration keys to your app's
Info.plistunder aTSKConfigurationdictionary. - Set the
kTSKSwizzleNetworkDelegateskey toYES.
TrustKit will then automatically perform method swizzling on NSURLSession and NSURLConnection delegates to validate connections.
Limitations: Do not use auto-swizzling if:
- Your app has complex connection delegates (e.g., for client certificate authentication).
- Another module/library is already swizzling connection delegates.
- Your app does not use
NSURLSessionorNSURLConnection.