Latest 0.2.0
Homepage https://github.com/junmo-kim/RxToBolts
License MIT
Platforms ios 8.0
Dependencies RxSwift, Bolts
Authors

Objective-C Bolts wrapper for RxSwift one time event traits

Build Status

If you want to introduce RxSwift but hesitated from tons of legacy Objective-C classes, this can help.

Get started

  1. In Podfile add this and install

    pod 'RxToBolts'
  2. Write your Rx code in Swift

    @objc class Service {
    func getStatus() -> Single<Status> {
        return Single<Status>.create { observer -> Disposable in
            [...]
        }
    }
    }
  3. Add wrapper method without any efforts

    extension Service {
    @objc func objc_getStatus() -> BFTask<Status> {
        return getStatus().toBoltsTask()
    }
    }
  4. Use it on Objective-C
    - (void)didTapLoadStatus {
    [[Service objc_getStatus] continueWithBlock:^id(BFTask *task) {
        if (task.isCancelled) {
            // get status was cancelled.
        } else if (task.error) {
            // get status failed.
        } else {
            Status *status = task.result;
            NSLog(@"Status: %@", status.text);
        }
        return nil;
    }];
    }

:tada:

Latest podspec

{
    "name": "RxToBolts",
    "version": "0.2.0",
    "summary": "Objective-C Bolts wrapper for RxSwift one time event traits",
    "homepage": "https://github.com/junmo-kim/RxToBolts",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Junmo Kim": "[email protected]"
    },
    "social_media_url": "https://www.linkedin.com/in/junmo-kim/",
    "dependencies": {
        "RxSwift": [
            "~> 4.0"
        ],
        "Bolts": [
            "~> 1.9.0"
        ]
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/junmo-kim/RxToBolts.git",
        "tag": "0.2.0"
    },
    "source_files": "RxToBolts/*.swift",
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This