有用的 Swift NSOperation 和 NSOperationQueue 子类
OTO业务
有用的 Swift () 和 () 子类。NSOperation
Operation
NSOperationQueue
OperationQueue
可扩展、线程安全且自动完全报告嵌套子操作的进度。
- 基础
BasicOperation
和BasicAsyncOperation
- 基于闭包
ClosureOperation
和AsyncClosureOperation
InteractiveClosureOperation
和InteractiveAsyncClosureOperation
- 线程安全的原子可变性
AtomicBlockOperation
安装:Swift Package Manager (SPM)
应用程序中的依赖关系
- 使用 Swift Package Manager 将包添加到您的 Xcode 项目中
- 选择“文件→ Swift 包→添加包依赖项”
- 使用作为 URL 添加包。
https://github.com/orchetect/OTOperations
- 根据需要将模块导入 *.swift 文件中。
import OTOperations
Swift 包中的依赖关系
-
在包.swift文件中:
dependencies: [ .package(url: "https://github.com/orchetect/OTOperations", from: "1.0.0") ],
-
@_implementationOnly
防止将 中的方法和属性导出到 SPM 包的使用者。OTOperations
@_implementationOnly import OTOperations
文档
Most methods are implemented as category methods so they are generally discoverable.
All methods have inline help explaining their purpose and basic usage examples.
Author
Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself @orchetect.
License
Licensed under the MIT license. See LICENSE for details.
Contributions
Bug fixes and improvements are welcome. Please open an issue to discuss prior to submitting PRs.