CwlUtils 2.2.0

CwlUtils 2.2.0

Matt Gallagher 维护。



CwlUtils 2.2.0

  • 作者:
  • Matt Gallagher

CwlUtils

《Cocoa with Love》博客文章中编写的实用工具集合

包含的功能

以下特性包含在库中。

将库添加到项目中

该项目可以通过多种方式集成到您的项目中。

这些方法都有相应的标准限制,您需要根据具体情况和偏好选择合适的方法。

最低要求为 iOS 8 或 macOS 10.10。

手动导入

  1. 在项目目录的子目录中,运行 git clone https://github.com/mattgallagher/CwlUtils.git
  2. 将 "CwlUtils.xcodeproj" 文件从 Finder 拖到 Xcode 中的项目文件树中您自己的位置
  3. 将 "CwlUtils.framework" 从 "CwlUtils" 项目的 "Products" 文件夹拖到任何目标中包含此模块的 "Copy Files (Frameworks)" 编译阶段

静态包含文件

这种方法会生成一个名为 CwlUtils.swift 的合并文件,可以直接添加到另一个项目中(不需要动态框架、库或其他设置)。

这种方法将省略 CwlStackFrame.swift、CwlAddressInfo.swift、CwlUnanticipatedError.swift 和 CwlFrameAddress.c 文件(因为这些文件不能通过单个文件方式包含)。如果需要这些文件,请使用其他包含策略之一。

  1. 通过在命令行中运行 git clone https://github.com/mattgallagher/CwlUtils.git 来获取 CwlUtils 的最新版本。
  2. 在 Xcode 中打开 CwlUtils.xcodeproj,并选择目标为 "My Mac" 的 CwlCwlUtilsConcat 架构(可以在工具栏中的“Scheme”下拉菜单或菜单栏的“Product”→“Scheme”和“Product”→“Destination”菜单中进行选择)。
  3. 构建架构(按 Command-B 或“Product”→“Build”)
  4. 在 Xcode 项目的文件树中右键单击(或 Control-click)“Products”文件夹,然后选择“Show in Finder”。打开此窗口中“Products”文件夹的“Debug”文件夹。

在 "Concat_internal" 文件夹中应该有 "CwlUtils_internal.swift" 文件。您可以将此文件复制并包含在任何自己的项目中,就像其他文件一样。

还应有一个名为 "Concat_public" 的文件夹。这个版本几乎与 "Concat_internal" 版本相同,只是 "Concat_internal" 版本删除了 publicopen 特定符,而 "Concat_public" 版本保留了这些特定符。这使得 "Concat_public" 版本可以在 Swift playgrounds 的 "Sources" 文件夹或其他需要从模块导出功能的地方使用。

Swift包管理器

将以下内容添加到您的"Package.swift"文件中的dependencies数组中

.Package(url: "https://github.com/mattgallagher/CwlUtils.git", majorVersion: 1),

或者,如果您正在使用swift-tools-version:4.0包管理器,则将以下内容添加到"Package.swift"文件中的dependencies数组中

.package(url: "https://github.com/mattgallagher/CwlUtils.git", majorVersion: 1)

注意:尽管此git仓库在其依赖项文件夹中包含了依赖项,但通过Swift包管理器构建时会独立地检索和构建这些依赖项。

CocoaPods

将其添加到您的"Podfile"中的目标

pod 'CwlUtils', :git => 'https://github.com/mattgallagher/CwlUtils.git'

Carthage

将其行添加到您的Cartfile中

git "https://github.com/mattgallagher/CwlUtils.git" "master"