Latest 1.0.0
Homepage https://github.com/youngshook/YSDynamicProperties
License MIT
Platforms ios 4.3
Frameworks Foundation
Authors

Cocoapods

Dynamic Accessors for Category Properties

The Problem

Tired of the Runtime objc_getAssociatedObject objc_setAssociatedObject to the Category implementation method of @Dynamic Property?

Link Blog Post

Installation

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

pod 'YSDynamicProperties'

Usage

  1. Add #import "NSObject+YSDynamicProperties.h" to Category file.
  2. Define properties in .h Category file.
  3. Add @dynamic statement for each property in .m file.

Example:

@interface Superman (YSKit)
@property (strong, nonatomic) UIColor *ys_ShirtColor;
@property (strong, nonatomic) NSArray *ys_Weapons;
@end
#import "NSObject+YSDynamicProperties.h"

@implementation Superman (YSKit)
@dynamic ys_ShirtColor, ys_Weapons;

+ (void)load
{
  [self implementDynamicPropertyAccessors];
}

@end

License

This code is distributed under the terms and conditions of the MIT license.

Donate

You can support me by:

:-)

Contact

Latest podspec

{
    "name": "YSDynamicProperties",
    "version": "1.0.0",
    "summary": "Obj-C Category that make add Category Dynamic property easy.",
    "homepage": "https://github.com/youngshook/YSDynamicProperties",
    "license": "MIT",
    "authors": {
        "Young Shook": "[email protected]"
    },
    "social_media_url": "http://twitter.com/young_shook",
    "source": {
        "git": "[email protected]:youngshook/YSDynamicProperties.git",
        "tag": "1.0.0"
    },
    "platforms": {
        "ios": "4.3"
    },
    "requires_arc": false,
    "frameworks": "Foundation",
    "source_files": "YSDynamicProperties/*.{h,m}",
    "public_header_files": "YSDynamicProperties/*.h"
}

Pin It on Pinterest

Share This