Latest 0.1.0
Homepage https://github.com/renatosarro/StwHelpers
License MIT
Platforms ios 7.0, requires ARC
Authors

The idea behind this lib is to join a collection of utilities to help you simplify your project making it cleaner.
#
To this first commit, let’s begin with something small, like a sort array – for example.
#
Hope you can join this and make it to growing with more and more libs =)

Pod

Podfile

pod "StwHelpers"

Terminal

pod install

NSArray – Order by

Our first collection is a NSArray Category with a simple method that enables you sort your list in a simple and easy way.
#
#
The codes below sorts a list of Strings – ascending and descneding.
#

NSArray *list = @[@"Renato", @"Carol", @"Carlos", @"Thiago", @"Andre", @"Ana"];

//ascending
list = [list orderAscByKey:nil];

//descending
list = [list orderDescByKey:nil];

NSLog(@"%@", [list orderDescByKey:nil]);

#
#
The codes below sorts a list of Objects (PeopleModel) by a property – ascending and descneding.
#

//Model
@interface PeopleModel : NSObject
    @property (copy, nonatomic) NSString *name;
    @property (nonatomic) NSInteger age;
@end

/*
... your data initialization ...
*/

//init array
NSArray *list = @[people1, people2, people3];

//ascending by name
list = [list orderAscByKey:@"name"];

//descending by age
list = [list orderAscByKey:@"age"];

#
Well, for now, thats all folks!
#
Soon, more collections will be avaiable here.
#
#
Swift version’s comming soon o/

#
#
#

Carry on!

Latest podspec

{
    "name": "StwHelpers",
    "version": "0.1.0",
    "summary": "Helper collection",
    "description": "Helper collection to turn your code cleaner",
    "homepage": "https://github.com/renatosarro/StwHelpers",
    "license": {
        "type": "MIT",
        "file": "LICENSE.txt"
    },
    "authors": {
        "Renato Matos": "[email protected]"
    },
    "source": {
        "git": "https://github.com/renatosarro/StwHelpers.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/rmatos_",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Categories/*.{h,m}",
    "resource_bundles": {
        "StwHelpers": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Categories/*.h"
}

Pin It on Pinterest

Share This