SwifterSwift is a collection of over 500 native Swift 3 extensions, with handy methods, syntactic sugar, and performance improvements for wide range of primitive data types like SwiftStdlib, Foundation, UIKit, AppKit and many other classes. –over 500 in 1– for iOS, macOS, tvOS and watchOS.
⚠️ To use with Swift 3 / Xcode 8.x please ensure you are using v3.1.1.
⚠️ To use with Swift 3.2 / Xcode 9.x please ensure you are using v3.2.
⚠️ To use with Swift 4 / Xcode 9.x please ensure you are using the swift-4 branch.
- iOS 8.0+ / tvOS 9.0+ / watchOS 2.0+ / macOS 10.10+
- Xcode 8.0+
- Swift 3.0+
CocoaPods
To integrate SwifterSwift into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'SwifterSwift'pod 'SwifterSwift/SwiftStdlib'pod 'SwifterSwift/Foundation'pod 'SwifterSwift/AppKit'pod 'SwifterSwift/CoreGraphics'pod 'SwifterSwift/CoreLocation'Carthage
To integrate SwifterSwift into your Xcode project using Carthage, specify it in your Cartfile:
github "SwifterSwift/SwifterSwift" ~> 3.0
Swift Package Manager
You can use The Swift Package Manager to install SwifterSwift by adding the proper description to your Package.swift file:
import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.Package(url: "https://github.com/SwifterSwift/SwifterSwift.git", majorVersion: 3),
]
)
Note that the Swift Package Manager is still in early design and development, for more information checkout its GitHub Page
Manually
Add the extensions folder to your Xcode project to use all extensions, or a specific extension.
SwiftStdlib Extensions
Foundation Extensions
UIKit Extensions
UIAlertController extensionsUIBarButtonItem extensionsUIButton extensionsUICollectionView extensionsUIColor extensionsUIImage extensionsUIImageView extensionsUILabel extensionsUINavigationBar extensionsUINavigationController extensionsUINavigationItem extensionsUISearchBar extensionsUISegmentedControl extensionsUISlider extensionsUIStoryboard extensionsUISwitch extensionsUITabBar extensionsUITableView extensionsUITextField extensionsUITextView extensionsUIViewController extensionsUIView extensions
SwifterSwift is a library of over 500 properties and methods, designed to extend Swift's functionality and productivity, staying faithful to the original API design guidelines of Swift 3.
Check Examples.md for some cool examples!
A complete documentation for all extensions with examples is available at swifterswift.com/docs
Your feedback is always appreciated and welcomed. Please refer to contributing guidelines before participating.
It is always nice to talk with other people using SwifterSwift and exchange experiences, Join Channel
Special thanks to:
- Steven Deutsch and Luciano Almeida for their latest contributions to extensions, docs and tests.
- Paweł Urbanek for adding tvOS, watchOS and macOS initial support and helping with extensions.
- Mert Akengin and Bashar Ghadanfar for designing project website and logo.
- Abdul Rahman Dabbour for helping document the project.