-
Notifications
You must be signed in to change notification settings - Fork 1
/
Bind.h
30 lines (20 loc) · 930 Bytes
/
Bind.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
// Bind.h
//
// Created by Ayal Spitz on 7/21/11.
// Copyright 2011 Ayal Spitz. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NSObject *(^TransformBlock)(NSObject *);
typedef BOOL(^ValidationBlock)(NSObject *);
@interface Bind : NSObject
@property (nonatomic, strong) NSObject *srcObj;
@property (nonatomic, strong) NSString *srcKeyPath;
@property (nonatomic, strong) NSObject *dstObj;
@property (nonatomic, strong) NSString *dstKeyPath;
@property (nonatomic, assign) TransformBlock transform;
@property (nonatomic, assign) ValidationBlock validation;
- (id)initWithSrc:(NSObject *)src srcKeyPath:(NSString *)srcPath dst:(NSObject *)dst andDstKeyPath:(NSString *)dstPath withTransform:(TransformBlock)tBlock andValidation:(ValidationBlock)vBlock;
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
- (void)remove;
@end