Latest 0.1.0
Homepage https://github.com/vipul8989/VTNilReplace
License MIT
Platforms ios 9.3
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

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

pod 'VTNilReplace'

Author

vipul8989, [email protected]

Getting Started:

    Just call by VTNullReplacer()

For removing NSNull values from a dictionary.

    NullReplace().dictionaryOfFilteredBy(dict: yourDictionary)

For removing NSNull values from an array.

    NullReplace().arrayOfFilteredBy(arr: yourArray)

Dictionary Example:

    let myDictionary : NSMutableDictionary = NSMutableDictionary()      // let a dictionary
    myDictionary.setValue(123, forKey: "firstKey")                      // add integer value
    myDictionary.setValue(NSNull(), forKey: "secondKey")                // add null value
    myDictionary.setValue([String](), forKey: "thirdKey")               // add array of string
    myDictionary.setValue("one", forKey: "fourthKey")                   // add string value
    myDictionary.setValue([String : AnyObject](), forKey: "fifthKey")   // add a dictionary

    let filteredDict : NSDictionary = NullReplace().dictionaryOfFilteredBy(dict: myDictionary) // call replacer
    print(filteredDict)

    input :
    {
        firstKey = 123;
        secondKey = "<null>";
        thirdKey = (
        );
        fourthKey = "one";
        fifthKey = {
        };
    }

    output :
    {
        firstKey = "123";
        secondKey = "";
        thirdKey = (
        );
        fourthKey = "one";
        fifthKey = {
        };
    }

License

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

Latest podspec

{
    "name": "VTNilReplace",
    "version": "0.1.0",
    "summary": "A NSArray and NSDictionary Category to replace NSNull values from NSArray and NSDictionary.",
    "description": "TODO: 'This code is a simple Objective-C Category implementation of NSArray and NSDictionary which replaces NSNull values from NSArray and NSDictionary.'",
    "homepage": "https://github.com/vipul8989/VTNilReplace",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "vipul8989": "[email protected]"
    },
    "source": {
        "git": "https://github.com/vipul8989/VTNilReplace.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.3"
    },
    "source_files": "VTNilReplace/Classes/**/*"
}

Pin It on Pinterest

Share This