FlockForge 1.1.7

FlockForge 1.1.7

Maintained by Ayush Goel, Yatin Sarbalia, Dinesh Kumar.



  • By
  • Ayush Goel

Forge

Version License Platform

Simple Task handler for iOS

Features

  • Task persistence across app restarts
  • Start tasks with delay (simulating undo)
  • Have tasks retriable
  • Task viewer for debugging
  • extensive logging support

Requirements

  • Swift 4.2+
  • iOS 11+

Installation

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate Forge into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'FlockForge',

Example

  1. Create Forge and optionally listen to changes
let forge = Forge(with: "test")
let changeManager = TestChangeManager() // An object following `ChangeManager` protocol.
forge.changeManager = changeManager
  1. Add an executor to handle tasks for a particular type
let executor = TestExecutor() // An object following `Executor` protocol.
try! forge.register(executor: executor, for: "t") // Register executor for tasks with type "t"
  1. Create a task and submit to forge
let params = ["params": "params"]
let task = try! Task(id: "id", type: "t", params: params) // Create task
forge.submit(task: task)
  1. [Optional] Presenting the Forge Tasks View Controller

    1. Create the View controller
    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. Present the created ViewController in your view heirarchy.

Note: To give it a spin, you can use the Tests project in Tests folder. Run pod install before opening the workspace.

Architecture

Please read architecture doc for more details.

Credits

License

Forge is available under the BSD 3-Clause license. See the LICENSE file for more info.