Skip to content
/ DaKit Public

davidlii's serialize & copy tools for Objective-C developing~

License

Notifications You must be signed in to change notification settings

davidli-/DaKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DaKit

CI Status Version License Platform

Example

自定义对象:

#import "Card.h"

//引入头文件
#import <DaKit/DaSerialize.h>
#import <DaKit/DaKakashi.h>

@implementation Card

//使用宏
DaSerialize() //serialize
DaKakashi()   //copy

@end

使用示例:

#import "Card.h"
#import <DaKit/DaClassInfo.h>

- (void)example{
    Card *card = [[Card alloc] init];
    card.cardNumber = 100;
    card.money = 50000000;

    // 序列化
    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:card];
    Card *card2 = [NSKeyedUnarchiver unarchiveObjectWithData:data];
    
    // 复制
    Card *card3 = [card2 copy];

    // 获取类的信息
    NSArray *ivars = [DaClassInfo ivarListWithClass:[Card class]];
    NSArray *props = [DaClassInfo propertyListWithClass:[Card class]];
    NSArray *meths = [DaClassInfo methodListWithClass:[Card class]];
}

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

Requirements

Installation

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

pod 'DaKit'

Author

davidlii, [email protected]

License

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

About

davidlii's serialize & copy tools for Objective-C developing~

Resources

License

Stars

Watchers

Forks

Packages

No packages published