Swift 通用工具

支持开发 Swift 代码的代码。

目录

实用工具

一个 Utility 命名空间,用于在您的应用程序中托管实用功能。

Applicative

内联函数式 Applicative 协议,支持将闭包应用于实例,并返回该实例。

注意: 类型必须符合该协议才能继承该行为,因为像 Any 这样的非命名类型无法被扩展。

RuntimeError

一种字符串化的错误类型,代表运行时错误。

副作用实用工具

在方法链和条件级联中启用调试。

SynchronousData

使用 URLSession 请求同步数据。

类型实用工具

集合实用工具

Result 实用工具

String 实用工具

安装

PROJECT > Swift Packages > Install (项目 > Swift Packages > 安装)

https://github.com/erica/https://github.com/erica/Swift-General-Utility

SwiftPM

dependencies: [
.package(url: "https://github.com/erica/Swift-General-Utility", from: "x.x.x"), // replace with version
],
targets: [
    .target(
        name: "TARGET-NAME",
        dependencies: [
           .product(name: "GeneralUtility", package: "Swift-General-Utility"),
        ],
    ),
],