Skip to content

Latest commit

History

242 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Forge

VersionLicensePlatform

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
letforge=Forge(with:"test")letchangeManager=TestChangeManager() // An object following `ChangeManager` protocol.
forge.changeManager = changeManager
  1. Add an executor to handle tasks for a particular type
letexecutor=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
letparams=["params":"params"]lettask=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
    letstoryBoard=UIStoryboard(name:"ForgeTask", bundle:Bundle(for:Forge.self))guardlet forgeTasksVC = storyBoard.instantiateViewController(withIdentifier:"ForgeTasksViewController")as?ForgeTasksViewControllerelse{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.

About

Task handler for iOS that can persist tasks across restarts and intelligently retry them

Topics

Resources

Stars

2 stars

Watchers

8 watching

Forks

Releases

Packages

Contributors

Languages