Latest 3.1.1
Homepage https://github.com/xareelee/XLReactiveCocoaExtensions
License MIT
Platforms ios 7.0, requires ARC
Authors

The missing part of ReactiveCocoa for development. This library provides some useful RACSignal(s).

Since 3.x, this library current only supports ReactiveObjC 1.x.

Install via CocoaPods

pod 'XLReactiveCocoaExtensions', '~> 3.0'

API

RAC Extensions

-[RACSignal racExt_hasValue]: evalute value and return a boolean value

// return NO
[[RACSignal return:nil] racExt_hasValue];
[[RACSignal return:[NSNull null]] racExt_hasValue];
[[RACSignal return:@""] racExt_hasValue]; // empty string is @NO
[[RACSignal return:@0] racExt_hasValue];  // 0 is @NO
// return YES
[[RACSignal return:@"hello"] racExt_hasValue];
[[RACSignal return:@100] racExt_hasValue];
// evaluate by calling -hasValue on objects (you could extend it by Category)
[[RACSignal return:obj] racExt_hasValue]; // evaluate -[obj hasValue]

-[RACSignal racExt_isValidEmail]: evaluate whether the value is valid email format. Useful with UITextField.

[[RACSignal return:nil] racExt_isValidEmail]; // NO
[[RACSignal return:@""] racExt_isValidEmail]; // NO
[[RACSignal return:@"hello"] racExt_isValidEmail]; // NO
[[RACSignal return:@"[email protected]"] racExt_isValidEmail]; // NO
[[RACSignal return:@"[email protected]"] racExt_isValidEmail]; // YES
[[RACSignal return:@1] racExt_isValidEmail]; // raise exception on DEBUG for non-string types

NSTimer

// Count up from 0: a signal which will count from 0 to 5 every second.
// events: 0-1-2-3-4-5|
RACSignal *counter$ = [NSTimer racExt_countUpWithTimeInterval:1 fromZeroTo:5];

// Count down to 0: a signal which will count from 5 to 0 every second.
// events: 5-4-3-2-1-0|
RACSignal *counter$ = [NSTimer racExt_countDownWithTimeInterval:1 toZeroFrom:5];

Latest podspec

{
    "name": "XLReactiveCocoaExtensions",
    "version": "3.1.1",
    "license": "MIT",
    "summary": "The missing part of ReactiveCocoa for development",
    "homepage": "https://github.com/xareelee/XLReactiveCocoaExtensions",
    "authors": {
        "Kang-Yu Xaree Lee": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xareelee/XLReactiveCocoaExtensions.git",
        "tag": "3.1.1",
        "submodules": true
    },
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "default_subspecs": "Core",
    "subspecs": [
        {
            "name": "Core",
            "source_files": [
                "XLReactiveCocoaExtensions/*.h",
                "XLReactiveCocoaExtensions/RACExtensions/*.{h,m}",
                "XLReactiveCocoaExtensions/Foundation/*.{h,m}",
                "XLReactiveCocoaExtensions/UIKit/*.{h,m}"
            ],
            "frameworks": [
                "Foundation",
                "UIKit"
            ],
            "dependencies": {
                "ReactiveObjC": [
                    "~> 1.0"
                ]
            }
        }
    ]
}

Pin It on Pinterest

Share This