https://github.com/dulacp/dpfoundation
A minimal set of additions and tools to any iOS app.
https://github.com/dulacp/dpfoundation
Last synced: 2 months ago
JSON representation
A minimal set of additions and tools to any iOS app.
- Host: GitHub
- URL: https://github.com/dulacp/dpfoundation
- Owner: dulacp
- License: mit
- Created: 2013-08-13T11:08:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-07T00:36:22.000Z (about 11 years ago)
- Last Synced: 2025-01-11T21:12:12.230Z (4 months ago)
- Language: Objective-C
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DPFoundation
*A minimal set of tools and additions to help you with any iOS app.*## Core
Define a `DPCore` class, useful through the `sharedCore` singleton method.
Usually, you will subclass this one to make your own *core* with a similar code :**YourCore.h**
```objective-c
#import "DPCore.h"@interface YourCore : DPCore
@end
```**YourCore.m**
```objective-c
#import "YourCore.h"@implementation YourCore
+ (instancetype)sharedCore {
static YourCore *_sharedCore = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedCore = [[YourCore alloc] init];
});
return _sharedCore;
}- (void)configureAppearance
{
// your own custom UIAppearance calls
// ...
}@end
```## Useful macros
The most useful macros are the `RGBCOLOR` and `RGBACOLOR` ones. I can't live without it ;)
## Foundation additions
### NSDateFormatter+Utils
Methods to get a `NSString` from a `NSDate` instance, with the little addition that it uses "Today", "Yesterday" and "Tomorrow" when it can.## UIKit Additions
### UIColor+Variants
Generate lighter/darker color from a `UIColor` instance.### UIImage+Generators
Generate `UIImage` from a `UIColor` instance, or `UIBezierPath` instance too.### UILabel+SizeUtils
Little helper to size a `UILabel` (**deprecated** due to the progressive use of Auto Layout).### UITableViewCell+Positions
Begin the support for cell position property.### UIView+Utils
Useful to get the first responder `UIView` instance from a view hierarchy.### UIView+Generators
Generate a `UIView` from a `UIBezierPath` instance.### UIViewController+NavigationUtils
Little helper method `dismissModalViewControllerAnimatedWithSender:` for storyboard use.