Swift-Misc-Utility

除了核心枚举之外,之前存在于 Swift-General-Utility 中的所有其他内容都已移至此处。

Applicative(应用函子)

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

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

RuntimeError(运行时错误)

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

Side effect utility(副作用实用工具)

允许在方法链和条件级联中进行调试。

SynchronousData(同步数据)

使用 URLSession 请求同步数据。

Type Utilities(类型实用工具)

Collection utility(集合实用工具)

Result utility(Result 实用工具)

String utility(字符串实用工具)

Installation(安装)

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

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

SwiftPM

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