-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCellViewModel.m
More file actions
55 lines (39 loc) · 1.13 KB
/
Copy pathCellViewModel.m
File metadata and controls
55 lines (39 loc) · 1.13 KB
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
//
// CellViewModel.m
// VMKExample
//
// Created by Andre Trettin on 07/02/2017.
// Copyright © 2017 Andre Trettin. All rights reserved.
//
#import "CellViewModel.h"
#import "SomeData+CoreDataClass.h"
NS_ASSUME_NONNULL_BEGIN
@interface CellViewModel ()
// protocol VMKCellViewModelType
@property (nonatomic, copy, readwrite, nullable) NSString *title;
@property (nonatomic, copy, readwrite, nullable) NSString *subtitle;
@property (nonatomic, strong, readwrite, nullable) UIImage *image;
@property (nonatomic, weak, readwrite, nullable) VMKViewModel *viewModel;
@end
NS_ASSUME_NONNULL_END
@implementation CellViewModel
#pragma mark - binding
- (VMKBindingDictionary *)modelBindings {
return @{
@"title":
[self bindingUpdaterOnSelector:@selector(titleDidChange)],
@"subtitle":
[self bindingUpdaterOnSelector:@selector(subtitleDidChange)],
};
}
- (void)titleDidChange {
self.title = self.model.title;
}
- (void)subtitleDidChange {
self.subtitle = self.model.subtitle;
}
#pragma mark - VMKCellType
- (VMKViewModel *)viewModel {
return nil;
}
@end