Slide 14
Slide 14 text
5 Oct 2015
@orta
@mrackwitz
INSIDE LD
1
2
3
4
5
6
7
8
9
10
#BananaKit.h
@import monkey;
@interface BKBananaTree
@property (copy) NSArray *fruits;
@end
@interface BKBananaFruit
@property (weak) MKMonkey *peeledByMonkey;
- (void)peel:(MKMonkey *)m;
@end
1
2
3
4
5
6
7
8
9
#monkey.h
typedef NS_ENUM(NSUInteger, MKSize) {
MKSizeSmall,
MKSizeBig
}
@interface MKMonkey
@property (nonatomic, assign) MKSize size;
- (id)init(MKSize)size;
@end
1
2
3
4
5
6
7
8
9
#main.m
@import monkey;
@import BananaKit;
void main() {
id m = [[MKMonkey alloc]
init:MKMonkeySmall];
id t = [BKBananaTree new];
t.fruits.first.peel(m);
}