-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
483 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// PhotoAnswerCell.h | ||
// unnamed | ||
// | ||
// Created by Bruce Ng on 2/24/15. | ||
// Copyright (c) 2015 com.yahoo. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "Survey.h" | ||
@interface PhotoAnswerCell : UITableViewCell | ||
@property (nonatomic, strong) Survey *survey; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// PhotoAnswerCell.m | ||
// unnamed | ||
// | ||
// Created by Bruce Ng on 2/24/15. | ||
// Copyright (c) 2015 com.yahoo. All rights reserved. | ||
// | ||
|
||
#import "PhotoAnswerCell.h" | ||
#import "PhotoAnswerView.h" | ||
#import "ProfileImageView.h" | ||
|
||
@interface PhotoAnswerCell() | ||
@property (weak, nonatomic) IBOutlet ProfileImageView *profileImageView; | ||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel; | ||
@property (weak, nonatomic) IBOutlet UILabel *questionLabel; | ||
@property (weak, nonatomic) IBOutlet PhotoAnswerView *photo1View; | ||
@property (weak, nonatomic) IBOutlet PhotoAnswerView *photo2View; | ||
|
||
@end | ||
|
||
@implementation PhotoAnswerCell | ||
|
||
- (void)awakeFromNib { | ||
// Initialization code | ||
} | ||
|
||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | ||
[super setSelected:selected animated:animated]; | ||
|
||
// Configure the view for the selected state | ||
} | ||
|
||
- (void)setSurvey:(Survey *)survey { | ||
_survey = survey; | ||
self.profileImageView.user = self.survey.user; | ||
self.nameLabel.text = self.survey.user.name; | ||
self.questionLabel.text = self.survey.question.text; | ||
|
||
[self.photo1View setAnswer:self.survey.answers[0] andTotalVotes:self.survey.totalVotes]; | ||
[self.photo2View setAnswer:self.survey.answers[1] andTotalVotes:self.survey.totalVotes]; | ||
} | ||
|
||
|
||
@end |
Oops, something went wrong.