-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake-code.m
32 lines (29 loc) · 1.05 KB
/
fake-code.m
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
- (void)viewDidLoad {
[super viewDidLoad];
// .. view configuration
self.questionFullyLoaded = NO;
self.inResultsView = NO;
self.commentBoxView.hidden = YES;
[self setupTextViewBackground];
// refresh the question data
[TCAPI getQuestionWithQuestionId:self.question.questionId
onComplete:^(NSArray *objects, RKObjectRequestOperation *operation, NSError *error) {
// ... table updates
[sself updateViewCommentStatus];
sself.questionFullyLoaded = YES;
[self updateChangeAnswerButtonText];
}];
}
- (IBAction)sendComment:(id)sender {
TCShallowComment *comment = [[TCShallowComment alloc] init];
// ... comment configuration
[self.commentTextBox resignFirstResponder];
// ... table updates
[self updateViewCommentStatus];
[TCAPI postComment:comment onComplete:^(NSArray *objects, RKObjectRequestOperation *operation, NSError *error) {
//TODO: Handle error
if (error) {
self.question.totalCommentsValue -= 1;
}
}];
}