Available thruCocoapods
Latest0.0.5
Homepagehttps://github.com/WedgeSparda/RPOFoundation
LicenseMIT

Version
License
Platform

What is this?

Coding is a repetitive work, and coders must avoid repeat their code, as Don’t Repeat Yourself principle says.

I still have many things to learn but experience and practice are more valuable when you share with the rest of the community and that’s why I create RPOFoundation.

This is a little library with some categories and helpers used for write less code and more one-liners. You can use it if you think it fits in one of your projects or you can add your code to help me improve it.


What it does?

Right now, RPOFoundation has this classes:

DLog

A macro shorcut for NSLog

DLog(@"This is a log with the number %d", 7);

will log this in DEBUG and do nothing in RELEASE

-[ClassName methodName:](0x7fda90f0a520) This is a log with the number 7

DeviceCheck

A macro paremeter called thisIsAniPad who returns YES if is running on iPad and NO in any other case.

UIColor+Utils

Category with some extra methods

+ (UIColor *)colorWithRGB:(NSString *) rgbColor;
+ (UIColor *)colorWithRGB:(NSString *) rgbColor alpha:(float) alpha;

UIViewController+Utils

Category with some extra methods

-(BOOL)isNavigationController;
-(void)removeBackButtonText;
-(UIViewController *)pushToStoryboardNamed:(NSString *) storyboardName
                        withViewIdentifier:(NSString *) viewIdentifier
                   returningViewController:(nextViewControllerBlock) block;
-(UIViewController *)presentStoryboardNamed:(NSString *) storyboardName
                         withViewIdentifier:(NSString *) viewIdentifier
                    returningViewController:(nextViewControllerBlock) block;

ScreenFlowHelper

Screen switching helper based on Maquert’s Sauron Project.

CoreDatahelper

A helper for the most common and simple Code Data operations.

+ (id) queryOneObjectWithEntityName:(NSString *)entityName
                          predicate:(NSPredicate *)predicate
                    sortDescriptors:(NSArray *)sortDescriptors
                            context:(NSManagedObjectContext *)context;
+ (id) queryOneObjectWithEntityName:(NSString *)entityName
                          predicate:(NSPredicate *)predicate
                            context:(NSManagedObjectContext *)context;
+ (NSArray *) queryObjectsWithEntityName:(NSString *)entityName
                               predicate:(NSPredicate *)predicate
                                 context:(NSManagedObjectContext *)context;
+ (NSArray *) queryObjectsWithEntityName:(NSString *)entityName
                               predicate:(NSPredicate *)predicate
                         sortDescriptors:(NSArray *)sortDescriptors
                                 context:(NSManagedObjectContext *)context;
+ (void)deleteAllObjectsWithEntityName:(NSString *)name inContext:(NSManagedObjectContext *)moc;
+ (void)deleteAllObjectsWithEntityNames:(NSArray *)names inContext:(NSManagedObjectContext *)moc;
+ (void)deleteAllObjectsWithEntities:(NSArray *)entities inContext:(NSManagedObjectContext *)moc;
+ (void)deleteAllObjectsWithEntityName:(NSString *)name predicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)moc;
+ (void)deleteAllObjectsWithEntityNames:(NSArray *)names predicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)moc;
+ (void)deleteAllObjectsWithEntities:(NSArray *)entities predicate:(NSPredicate *)predicate inContext:(NSManagedObjectContext *)moc;
+ (BOOL)saveContext:(NSManagedObjectContext *)moc;
+ (BOOL)saveContext:(NSManagedObjectContext *)moc error:(NSError *)error;
+ (NSManagedObjectContext *)newMOCWithParent:(NSManagedObjectContext *)parentMoc;

Usage

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

Installation

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

pod "RPOFoundation"

Author

Roberto Pastor, [email protected]

@Roberto_Pastor

License

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

Latest podspec

{
    "name": "RPOFoundation",
    "version": "0.0.5",
    "summary": "A little utilities library for iOS.",
    "description": "                       This is a little library i've been using since a while ago in order to:n                       * Reduce my code redundancy.n                       * Try to write cleaner code.n",
    "homepage": "https://github.com/WedgeSparda/RPOFoundation",
    "license": "MIT",
    "authors": {
        "Roberto Pastor": "[email protected]"
    },
    "source": {
        "git": "https://github.com/WedgeSparda/RPOFoundation.git",
        "tag": "0.0.5"
    },
    "social_media_url": "https://twitter.com/Roberto_Pastor",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "RPOFoundation": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This