要使用 CocoaPods 将 SwifterSwift 集成到您的 Xcode 项目,请在您的 Podfile
中设置:
pod 'SwifterSwift'
pod 'SwifterSwift/SwiftStdlib'
pod 'SwifterSwift/Foundation'
pod 'SwifterSwift/UIKit'
pod 'SwifterSwift/AppKit'
pod 'SwifterSwift/MapKit'
pod 'SwifterSwift/CoreGraphics'
pod 'SwifterSwift/CoreLocation'
pod 'SwifterSwift/SpriteKit'
pod 'SwifterSwift/SceneKit'
pod 'SwifterSwift/StoreKit'
pod 'SwifterSwift/Dispatch'
pod 'SwifterSwift/WebKit'
pod 'SwifterSwift/HealthKit'
要使用 Carthage 将 SwifterSwift 集成到您的 Xcode 项目中,请在您的 Cartfile
中设置:
github "SwifterSwift/SwifterSwift" ~> 5.3
你可以使用 The Swift Package Manager 来安装 SwifterSwift,请在你的 Package.swift
文件中添加正确的描述:
import PackageDescription
let package = Package(
name: "YOUR_PROJECT_NAME",
targets: [],
dependencies: [
.package(url: "https://github.com/SwifterSwift/SwifterSwift.git", from: "5.3.0")
]
)
接下来,将 SwifterSwift
添加到您的 targets 依赖项中,如下所示:
.target(
name: "YOUR_TARGET_NAME",
dependencies: [
"SwifterSwift",
]
),
然后运行 swift package update
。
请注意,Swift Package Manager 不支持为 iOS/tvOS/macOS/watchOS 应用程序编译 - 请参阅下一节中的 Accio。
Accio 是一个基于 SwiftPM 的依赖管理器,可以为 iOS/macOS/tvOS/watchOS 构建框架。因此,集成步骤与上述完全相同。一旦你的 Package.swift
文件被配置,你需要运行 accio update
而不是 swift package update
。
Array extensions
BidirectionalCollection extensions
BinaryFloatingPoint extensions
Bool extensions
Character extensions
Collection extensions
Comparable extensions
DecodableExtensions extensions
DefaultStringInterpolationExtensions extensions
Dictionary extensions
Double extensions
Float extensions
FloatingPoint extensions
Int extensions
Optional extensions
RangeReplaceableCollection extensions
Sequence extensions
SignedInteger extensions
SignedNumeric extensions
String extensions
StringProtocol extensions
UIActivity extensions
UIAlertController extensions
UIApplication extensions
UIBarButtonItem extensions
UIButton extensions
UICollectionView extensions
UIColor extensions
UIDatePicker extensions
UIEdgeInsets extensions
UIFont extensions
UIGestureRecognizer extensions
UIImage extensions
UIImageView extensions
UILabel extensions
UILayoutPriority extensions
UINavigationBar extensions
UINavigationController extensions
UINavigationItem extensions
UIRefreshControl extensions
UIScrollView extensions
UISearchBar extensions
UISegmentedControl extensions
UISlider extensions
UIStackView extensions
UIStoryboard extensions
UISwitch extensions
UITabBar extensions
UITableView extensions
UITextField extensions
UITextView extensions
UIViewController extensions
UIView extensions
UIWindow extensions