Guide · Open source
How to use SwifterSwift: install and call Swift extensions
Updated · written with AI from the project's own documentation and checked against our catalogue data
SwifterSwift is an open-source collection of more than 500 Swift extensions, which add handy methods to built-in types such as strings and arrays, and to UIKit and Cocoa classes. This guide shows Swift developers how to install it, choose which extension groups to include, and start calling its helpers in iOS, macOS, tvOS, watchOS, Linux or Android projects.
Quick start
- 1Check your toolchain. Confirm you have Xcode with Swift 6.0+ support and your target platform meets the minimum versions listed in the README.
- 2Choose a dependency manager. Pick Swift Package Manager, CocoaPods or Carthage based on how your project is set up.
- 3Add SwifterSwift. Add the package or pod line from the README to your Package.swift, Podfile or Cartfile.
- 4Limit to needed groups. If you only need some areas, use a subspec such as SwifterSwift/UIKit or SwifterSwift/CoreLocation instead of the full pod.
- 5Update dependencies. Run swift package update for Swift Package Manager, or the install step for CocoaPods or Carthage.
- 6Call the helpers. Import the module and call the extension methods, checking the linked source files for exact signatures.
What SwifterSwift is and who it is for
SwifterSwift is a collection of over 500 native Swift extensions. An extension adds new methods to an existing type, so helpers you would otherwise write yourself become available directly on strings, arrays, and UIKit or Cocoa classes.
It is aimed at Swift developers building iOS or macOS apps who want common helper methods ready to use, and at teams that want to include only the extension groups they need. The library assumes you can read and call extensions yourself, so it is not a starting point for people still learning Swift basics.
- Good fit: iOS or macOS developers who want ready-made helper methods.
- Good fit: teams that want only groups such as UIKit or CoreLocation.
- Not a fit: a full app or framework; SwifterSwift is a set of helper methods.
Check the requirements before you install
The README lists the minimum platform versions as iOS 15.0+, tvOS 12.0+, watchOS 9.0+, macOS 12.0+, visionOS 1.0+, Mac Catalyst 15.0+ and Ubuntu 14.04+, and it requires Swift 6.0+. You need Xcode with Swift 6.0+ support, plus Swift Package Manager, CocoaPods or Carthage, depending on your setup.
If your project must use an older Swift version, the README points to older tagged releases rather than the current one. It states that the library is Swift v5.0+ compatible starting from v5, and links v3.1.1 for Swift 3 and v3.2.0 for Swift 3.2.
Install SwifterSwift with Swift Package Manager
For Swift Package Manager, add the package to the dependencies in your Package.swift file, then add SwifterSwift to your target's dependencies. The README notes that Swift Package Manager does not support building iOS, tvOS, macOS or watchOS apps directly; for those, it points to Accio.
After editing the file, the README says to run swift package update.
import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.package(url: "https://github.com/SwifterSwift/SwifterSwift.git", from: "6.0.0")
]
)Install SwifterSwift with CocoaPods or Carthage
With CocoaPods, add the pod to your Podfile. The README recommends pod 'SwifterSwift' to integrate all extensions. If you only need one area, it lists subspecs such as SwiftStdlib, Foundation, UIKit, AppKit, MapKit, CoreGraphics, CoreLocation, CryptoKit, SpriteKit, SceneKit, StoreKit, Dispatch, WebKit and HealthKit.
With Carthage, add the line shown below to your Cartfile.
- Pick only what you need, for example pod 'SwifterSwift/CoreLocation'.
- Manual installation is also described: add the SwifterSwift folder to your Xcode project, either whole or a specific extension.
pod 'SwifterSwift'
github "SwifterSwift/SwifterSwift" ~> 6.0Call an extension in your code
Once the library is in your project, its extensions appear as methods on the types they extend. The README does not list individual method names in the part provided here, so check the extension files linked from its list of all extensions (for example ArrayExtensions.swift or DictionaryExtensions.swift) to see what each one offers.
The list of extensions is organised by group, such as SwiftStdlib, and each group links to its source file. Reading the file for a type you already use is the quickest way to learn what is available.
- Open the extension group for the type you use most.
- Read the method signatures in that file before writing your own helper.
- Keep only the groups your project imports to limit what you depend on.
Compare with similar projects
SwifterSwift is a broad helper library. Other projects in the same space solve narrower problems: Swift Algorithms, Kingfisher, SnapKit and Sourcery are listed as comparable projects. Choose based on the problem you have rather than on the number of features.
- Need many small helpers on built-in types and Cocoa classes: SwifterSwift.
- Need a specific tool, such as a particular library for a specific task: compare it with the projects above.
What people use it for
- Adding string and array helpers to an iOS app without writing them from scratch.
- Pulling in only UIKit or CoreLocation extensions to keep dependencies narrow.
- Sharing common Swift helpers across iOS, macOS and other platforms in one team.
- Using extensions on Cocoa and UIKit classes in a macOS or iOS codebase.
Frequently asked questions
Is SwifterSwift free to use?
Yes. SwifterSwift is released under the MIT licence, as shown in the README badge and the project's licence information.
What Swift version does SwifterSwift require?
The README states that it requires Swift 6.0+. If your project must use an older Swift version, the README points to older tagged releases for Swift 3 and 3.2.
How do I install SwifterSwift with CocoaPods?
Add pod 'SwifterSwift' to your Podfile to integrate all extensions, which the README recommends. To include only one area, use a subspec such as pod 'SwifterSwift/UIKit'.
Can I install only part of SwifterSwift?
Yes. With CocoaPods you can use subspecs for groups like SwiftStdlib, Foundation, UIKit, MapKit or CoreLocation, and the README also describes adding individual extension files manually.
Does Swift Package Manager work for iOS apps?
The README says Swift Package Manager does not support building iOS, tvOS, macOS or watchOS apps directly. It points to Accio, a SwiftPM-based dependency manager, for those platforms.
What should I use instead of SwifterSwift?
The README lists Swift Algorithms, Kingfisher, SnapKit and Sourcery as comparable projects. They cover different needs, so pick the one that matches your problem rather than a general helper library.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
SwifterSwift suits Swift developers building iOS or macOS apps who want a large set of ready-made helper methods and the option to include only the groups they need. It is a poor choice for beginners still learning Swift, for projects that must support Swift versions older than 6.0 without using the older tagged releases, or for anyone who wants a full app or framework rather than helper methods.
Install options & downloads