Swift and Objective-C
Snyk support for Swift and Objective-C with Snyk Code and Snyk Open Source, including Early Access Objective-C code analysis on Enterprise plans
Swift and Objective-C for Snyk Code
For an overview of the supported security rules, visit Swift rules and Objective-C rules.
For Swift with Snyk Code, Snyk supports Swift versions up to 5.7.x. You can use higher versions, but Snyk does not provide support for them.
Supported frameworks and libraries
For Swift and Objective-C, the following frameworks and libraries are supported:
AFNetworking
AlamoFire
AppKit
Asynchttpclient
CocoaLumberjack
CommonCrypto (Native API)
Commoncrypt
Cryptokit
Cryptor
Cryptoswift
dylanshine/openai-kit
Filekit
FMDB
Foundation
google-gemini/generative-ai-swift
IDZSwiftCommonCrypto
JLRoutes
MacPaw/OpenAI
Mantle
NSTask (Native API)
OneSignal-iOS-SDK
Pathos
Realm
RNCryptor
SDWebImage
ShellOut
Shout
SQLite3
Subprocess
Swift standard library
Swift UI
SwiftCLI
Swiftline
SwiftShell
UI Kit
Webkit
XLForm
ZXingObjC
Supported file formats
For Swift, Snyk supports .swift
For Objective-C, Snyk supports .m files, and implicitly supports .h files.
Available features
Reports
Interfile analysis
Swift and Objective-C for Snyk Open Source
For Swift with Snyk Open Source, Snyk supports Swifts versions from 3.0 up to 6.2.x.
Supported package managers and registries
For Swift and Objective-C, Snyk supports the following package managers: CocoaPods, Swift Package Manager v3.0 or higher.
As package registries, Snyk for Swift and Objective-C uses multiple sources, including cocoapods.org and swiftpackageregistry.com.
Supported file formats
For Swift and Objective-C with Snyk Open Source, the following file formats are supported:
For CocoaPods:
podfileandpodfile.lockFor Swift:
package.swift
For Swift and Objective-C with Snyk Open Source, Snyk provides support for package managers as follows:
For CocoaPods: CLI support, Git support, License scanning
For Swift Package Manager: CLI support
Requirements for Swift Package Manager
In order for Snyk to discover a Project, a Package.swift file must be present. Also, Snyk uses the swift package show-dependencies command to build the dependency graph.
When the .build folder of your Project is not present - in a pipeline, for example, it is possible that Snyk takes longer to scan your Swift Projects. When the CLI runs the command swift package show-dependencies, Swift must resolve the dependencies as part of this process, which can add to the overall time it takes Snyk to complete the scan. Therefore, ensuring that you have your Projects built first and that the .build folder is present can speed up the CLI processing time.
Swift Package Manager supports pre-processing and post-processing. For post-processing, custom commands can add extra dependencies. Detecting such dependencies is not supported.
It is not possible to scan Swift Package Manager Projects using SCM import.
Cocoapods and CLI
To build the dependency graph, Snyk examines the Podfile and Podfile.lock files.
When working with Swift and Objective-C projects from the Snyk CLI, you can prevent testing any lock files that are out-of-sync by using the --strict-out-of-sync=true
For Cocoapods and Git, to test your Projects, Snyk analyzes the Podfile and Podfile.lock files.
Last updated
Was this helpful?

