-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKarapuz.h
75 lines (48 loc) · 1.76 KB
/
Karapuz.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//==============================================================================
//
//
// Karapuz.h
// Karapuz
//
// Created by Vladimir Obrizan on 19.12.12.
// Copyright (c) 2012 Design and Test Lab. All rights reserved.
//
//
//==============================================================================
#import <Foundation/Foundation.h>
typedef void (^KarapuzBlock)(id src, NSString *pty2);
@interface Karapuz : NSObject
/// An array of bindings.
@property (nonatomic, retain) NSMutableArray *bindings;
/** Give an instance of Karapuz. It is a singleton.
*
* @return A Karapuz's instance.
*/
+(Karapuz *)instance;
/** Add observer 'dst' to observe property 'pty2' of the 'src' object.
*
* @param dst An object-observer.
* @param pty A property to be updated.
* @param src An object-source.
* @param pty2 A property being observed.
*/
+(void)dst:(id)dst pty:(NSString *)pty src:(id)src pty:(NSString *)pty2;
/** Removes the observer from all objects.
*
* @param dst The observer to be removed.
*/
+(void)remove:(id)dst;
+(void)removeAll;
+(void)dst:(id)dst block:(KarapuzBlock)block src:(id)src pty:(NSString *)pty2;
+(void)dst:(id)dst selector:(NSString *)selector withParams:(NSDictionary *)params src:(id)src pty:(NSString *)pty2;
+(void)dst:(id)dst selector:(SEL)selector src:(id)src pty:(NSString *)pty2;
@end
//==============================================================================
@interface WeakStore : NSObject
@property (nonatomic, weak) id store;
// Blocks must have the "copy" attribute, as they are allocated on the stack.
// http://stackoverflow.com/questions/3935574/can-i-use-objective-c-blocks-as-properties
@property (nonatomic, copy) KarapuzBlock storeBlock;
-(id)initWithObj:(id)obj;
-(id)initWithBlo:(KarapuzBlock)blo;
@end