FlockForge 1.1.7

FlockForge 1.1.7

Dinesh Kumar、【Yatin Sarbalia】和 Ayush Goel 维护。



  • Ayush Goel

Forge

Version License Platform

iOS 的简单任务处理器

特点

  • 应用程序重启后任务持久化
  • 延迟启动任务(模拟撤销操作)
  • 任务可重试
  • 任务查看器用于调试
  • 支持大量日志记录

要求

  • Swift 4.2+
  • iOS 11+

安装

CocoaPods 是 Cocoa 项目的依赖管理器。有关使用和安装说明,请访问他们的网站。要使用 CocoaPods 将 Forge 集成到您的 Xcode 项目中,请在 Podfile 中指定它。

pod 'FlockForge',

示例

  1. 创建 Forge 和可选地监听更改
let forge = Forge(with: "test")
let changeManager = TestChangeManager() // An object following `ChangeManager` protocol.
forge.changeManager = changeManager
  1. 为特定类型的任务添加一个执行器来处理任务
let executor = TestExecutor() // An object following `Executor` protocol.
try! forge.register(executor: executor, for: "t") // Register executor for tasks with type "t"
  1. 创建一个任务并将其提交给Forge
let params = ["params": "params"]
let task = try! Task(id: "id", type: "t", params: params) // Create task
forge.submit(task: task)
  1. [可选] 展示Forge任务视图控制器

    1. 创建视图控制器
    let storyBoard = UIStoryboard(name: "ForgeTask", bundle: Bundle(for: Forge.self))
    guard let forgeTasksVC = storyBoard.instantiateViewController(withIdentifier: "ForgeTasksViewController")
    as? ForgeTasksViewController else {
    fatalError("Could not instantiate TroubleshootController")
    }
    1. 在您的视图层次结构中呈现创建的视图控制器。

注意:为了试用,您可以使用“Tests”文件夹中的Test项目。在打开工作区之前运行pod install

架构

请参阅架构文档以获取更多详细信息。

致谢

许可证

Forge遵守BSD 3条款许可证。有关更多信息,请参阅LICENSE文件。