Skip to content

Commit edc3e88

Browse files
committed
Allow write access for GDDListModel's properties
1 parent 6478447 commit edc3e88

File tree

7 files changed

+4
-38
lines changed

7 files changed

+4
-38
lines changed

GDDataDrivenView.podspec

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ TODO: Add long description of the pod here.
6666
end
6767

6868
s.subspec 'Model' do |sp|
69-
sp.dependency 'Protobuf', '~> 3.0'
70-
7169
sp.source_files = 'GDDataDrivenView/Classes/Model/**/*', 'GDDataDrivenView/Classes/Service/**/*'
7270
end
7371
end
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#import "GDDModel.h"
22

3-
@class GPBMessage;
4-
53
@interface GDDListModel<__covariant ObjectType> : GDDModel
64

7-
@property(nonatomic, readonly) NSArray<ObjectType> *results;
8-
@property(nonatomic, readonly) NSString *nextCursor;
5+
@property(nonatomic) NSArray<ObjectType> *results;
6+
@property(nonatomic) id nextCursor;
97

10-
- (instancetype)initWithResults:(NSArray *)results response:(GPBMessage *)response;
8+
- (instancetype)initWithResults:(NSArray *)results;
119

1210
@end
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
#import "GDDListModel.h"
2-
#import "GPBMessage.h"
32

43
@interface GDDListModel ()
5-
@property(nonatomic, readonly) GPBMessage *response;
64
@end
75

86
@implementation GDDListModel
97

10-
- (instancetype)initWithResults:(NSArray *)results response:(GPBMessage *)response {
8+
- (instancetype)initWithResults:(NSArray *)results {
119
self = [super init];
1210
if (self) {
1311
_results = results;
14-
_response = response;
1512
}
1613

1714
return self;
1815
}
19-
20-
21-
- (NSString *)nextCursor {
22-
if ([self.response respondsToSelector:@selector(hasNextPage)] && ![[self.response valueForKey:@"hasNextPage"] boolValue]) {
23-
return nil;
24-
}
25-
return [self.response respondsToSelector:@selector(pageContext)] ? [self.response valueForKey:@"pageContext"] : nil;
26-
}
27-
2816
@end
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
//
2-
// Created by Larry Tin on 16/9/26.
3-
//
4-
51
#import <Foundation/Foundation.h>
62

7-
83
@interface GDDModel : NSObject
94
@end

GDDataDrivenView/Classes/Model/GDDModel.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
//
2-
// Created by Larry Tin on 16/9/26.
3-
//
4-
51
#import "GDDModel.h"
62

7-
83
@implementation GDDModel {
94

105
}

GDDataDrivenView/Classes/Service/GDDPagedListService.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Created by Larry Tin on 16/9/30.
3-
//
4-
51
#import <Foundation/Foundation.h>
62
#import "GDDListService.h"
73

GDDataDrivenView/Classes/Service/GDDRpc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//
2-
// Created by Larry Tin on 16/9/30.
3-
//
4-
51
#import <Foundation/Foundation.h>
62

73
@protocol GDDRpc

0 commit comments

Comments
 (0)