ReactiveCocoa import methods (OC project and Swift project)

ReactiveCocoa5.0 later split RAC into four libraries: ReactiveCocoa, ReactiveSwift, ReactiveObjC, and ReactiveObjCBridge. One of these is ReactiveCocoa and ReactiveObjC, one for your pure Swift project, and the other for pure OC projects.

Pure Swift project Cocoapods import

Content in the podfile file:

Platform:ios "7" / / use_frameworks target "must be added here! Write your project name 'do / here will default into the latest version of the ReactiveCocoa pod'ReactiveCocoa' end

Then pod install will install

Pure OC project Cocoapods import

Unlike the former, the imported library is ReactiveObjC rather than the content in the ReactiveCocoa
podfile file:

Platform:ios "7" / / use_frameworks target "must be added here! Write your project name 'do //ReactiveObjC contains the original RAC 2 contains all the code pod'ReactiveObjC' end

Then pod install will install

Import notes

  • If your project is Swift and OC mixed ReactiveObjC and ReactiveCocoa, then you will need to import, also need to manually import ReactiveObjCBridge.

Notice of use:

When using ReactiveCocoa:

Import the ReactiveCocoa.h header file (may not be automatic completion that can force input, can also create a.H file ReactiveCocoa.h into account, import the.H file created when in use)

When using ReactiveObjC:

Import the ReactiveObjC.h header file (may not be automatic completion that can force input, can also create a.H file ReactiveObjC.h into account, import the.H file created when in use)