This repository was archived by the owner on Dec 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-32
lines changed Expand file tree Collapse file tree 3 files changed +4
-32
lines changed Original file line number Diff line number Diff line change 10
10
11
11
@class RACSignal;
12
12
13
- // Adapts a domain model to be user-presentable , and implements behaviors that
14
- // drive the UI .
13
+ // Implements behaviors that drive the UI , and/or adapts a domain model to be
14
+ // user-presentable .
15
15
@interface RVMViewModel : NSObject
16
16
17
- // The model which the view model is adapting for the UI.
18
- @property (nonatomic , readonly , strong ) id model;
19
-
20
17
// Whether the view model is currently "active."
21
18
//
22
19
// This generally implies that the associated view is visible. When set to NO,
39
36
// upon subscription.
40
37
@property (nonatomic , strong , readonly ) RACSignal *didBecomeInactiveSignal;
41
38
42
- // Calls -initWithModel: with a nil model.
43
- - (instancetype )init ;
44
-
45
- // Creates a new view model with the given model.
46
- //
47
- // model - The model to adapt for the UI. This argument may be nil.
48
- //
49
- // Returns an initialized view model, or nil if an error occurs.
50
- - (instancetype )initWithModel : (id )model ;
51
-
52
39
// Subscribes (or resubscribes) to the given signal whenever
53
40
// `didBecomeActiveSignal` fires.
54
41
//
Original file line number Diff line number Diff line change @@ -80,21 +80,6 @@ - (RACSignal *)didBecomeInactiveSignal {
80
80
return _didBecomeInactiveSignal;
81
81
}
82
82
83
- #pragma mark Lifecycle
84
-
85
- - (id )init {
86
- return [self initWithModel: nil ];
87
- }
88
-
89
- - (id )initWithModel : (id )model {
90
- self = [super init ];
91
- if (self == nil ) return nil ;
92
-
93
- _model = model;
94
-
95
- return self;
96
- }
97
-
98
83
#pragma mark Activation
99
84
100
85
- (RACSignal *)forwardSignalWhileActive : (RACSignal *)signal {
Original file line number Diff line number Diff line change 13
13
__block RVMTestViewModel *viewModel;
14
14
15
15
beforeEach (^{
16
- viewModel = [[RVMTestViewModel alloc ] initWithModel: @" foobar " ];
16
+ viewModel = [[RVMTestViewModel alloc ] init ];
17
17
});
18
18
19
19
describe (@" active property" , ^{
79
79
deallocated = NO ;
80
80
81
81
createViewModel = ^{
82
- RVMTestViewModel *viewModel = [[RVMTestViewModel alloc ] initWithModel: nil ];
82
+ RVMTestViewModel *viewModel = [[RVMTestViewModel alloc ] init ];
83
83
[viewModel.rac_deallocDisposable addDisposable: [RACDisposable disposableWithBlock: ^{
84
84
deallocated = YES ;
85
85
}]];
You can’t perform that action at this time.
0 commit comments