Releases: railsware/BloodMagic
Major release
This version is incompatible with previous one
Lazy module was separated into Lazy and Injectable: Lazy could be used for lazy initialization, and Injectable for dependency injection.
This way any BloodMagic' component could be easily replaced or removed. so you're pretty safe to use it in your project.
Skip undefined protocol silently
Details here: #19
Preferences
Preferences
pod 'BloodMagic/Preference', :git => 'https://github.com/railsware/BloodMagic.git'Enjoy the simplest way to deal with NSUserDefaults
#import <BloodMagic/Preference.h>
@interface Settings : NSObject
<BMPreference>
@property (nonatomic, strong, bm_preference) NSString *nickname;
@end
@implementation Settings
@dynamic nickname;
@end
// ...
Settings *settings = [Settings new];
settings.nickname = @"AlexDenisov"; // @"AlexDenisov" goes to [NSUserDefaults standardUserDefaults] with key "nickname"
NSLog(@"My name is: %@", settings.nickname); // reads object for key "nickname" from [NSUserDefaults standardUserDefaults]Lazy loading hooks
BMLazy module provides a hook system to catch the object creation.
To enable these hooks just create instance method named propertyNameInjected:
For example:
@implementation ViewController
@lazy(progressViewService)
- (void)progressViewServiceInjected:(ProgressViewService *service)
{
service.title = self.title;
}
@endMultiple attributes support
From now you can use multiple different attributes per one class
#import <BloodMagic/Lazy.h>
#import <BloodMagic/Partial.h>
@interface ViewController : UIViewController
<BMLazy,
BMPartial>
@property (nonatomic, strong) ProgressViewService *progressViewService;
@property (nonatomic, strong) HeaderView *headerView;
@end
@implementation ViewController
@lazy(progressViewService)
@partial(headerView)
@endAssign-once properties
Added support of assign-once properties, like final in Java.
Added Partial views support
Added support of partial views: BMPartial
Added empty macro definitions: bm_lazy, bm_partial
Performance improvement
A lot of performance improvements.
Almost all collectors and finders use cache to achieve better performance.
BM uses STL for data caching.
Added ability to change default initializer
0.4.0 Release 0.4.0
Ability to exclude class from magic hierarchy
Added ability to exclude class from magic hierarchy (details), thanks to Eugene Solodovnykov