FIDataFlowArchitectureNew 1.5.2

FIDataFlowArchitectureNew 1.5.2

TestsTested
LangLanguage Obj-CObjective C
License Custom
ReleasedLast Release Jun 2016

Maintained by congncif.



 
Depends on:
ReactiveCocoa>= 0
JSONModel~> 1.1
 

FIDataFlowArchitecture

FIDataFlow sequence

Getting started

A Flow is a task, it start from fetching data, transforming data & finally refreshing UI if needed. In FIDataFlow, a IntegrateController will hold processing & start a serial flows. IntegrateController include LogicController for fetching data, pre-processing data and DataController for transforming data, that is sent from LogicController.
When a flow is started, these blocks of IntegrateController are performed:

  • start:
  • next:
  • end:
  • error:
  • completion: >(See more in code comments)>

To implement your flow, custom Logic&Data Controller.

  • to fetch data, override method:
    prepareSignalWithParameters:completion:compeltion
  • to transform data, override method:
    tranformDataIfNeed:error:
    By default, base logic controller will pre-process data & data controller will transform data to FIBaseModel (based from JSONModel) If your returned data is kind of JSON, you only define return model as FIBaseModel & override this method of DataController like:
    - (NSString*)classNameForReturnData{ return @"YourJSONModelClassName"; }

    Magically, you will receive return data as an object of your model class.

For advanced:

setup runningType for IntegrateController

  • FIFlowRunningTypeDefault: start asynchronous
  • FIFlowRunningTypeOnly: start only flow, wait finish to start new flow
  • FIFlowRunningTypeLastest: start serial flows, lastest flow will be started
  • FIFlowRunningTypeQueue: start serial flows, before started all flows are added to queue & start flow by flow, finish previous flow -> start next flow


More features: multiple logics in FIIntegrateController, transform data, .... -> Contact me!

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

FIDataFlowArchitecture is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "FIDataFlowArchitectureNew"

Author

NGUYEN CHI CONG, [email protected]

License

FIDataFlowArchitecture is available under the MIT license. See the LICENSE file for more info.