Skip to content

Commit

Permalink
[Issue #103] Fix issue where text field in answer cell was not being …
Browse files Browse the repository at this point in the history
…cleared, also hid answer table when no text in question text field
  • Loading branch information
casing committed Feb 22, 2015
1 parent 7959e5a commit d408ab2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion unnamed/ComposeAnswerCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ - (void)setSelected:(BOOL)selected animated:(BOOL)animated {

- (void)setAnswer:(Answer *)answer {
_answer = answer;

self.answerLabel.text = answer.text;
self.answerText.text = answer.text;

if ([answer.text length] > 0) {
self.answerLabel.text = answer.text;
self.answerLabel.alpha = 1;
self.answerText.alpha = 0;
} else {
self.answerLabel.alpha = 0;
self.answerText.alpha = 1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion unnamed/ComposeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)textViewDidChange:(UITextView *)textView {
}
self.questionTextCountLabel.text = [NSString stringWithFormat:@"%ld",(long)count];

[self showAddAnswerButton:(count >= 8)];
[self showAddAnswerButton:(count >= 0 && count < maxCount)];//Lets fold up the Answer table if No Question
}

#pragma mark - Add An Answer Button
Expand Down

0 comments on commit d408ab2

Please sign in to comment.