Skip to content

Commit

Permalink
Fix title bar on surveyViewController. Fix profile image on profile view
Browse files Browse the repository at this point in the history
  • Loading branch information
brung committed Feb 21, 2015
1 parent 6c621b3 commit 48815c6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 9 deletions.
8 changes: 7 additions & 1 deletion unnamed/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "ComposeViewController.h"
#import "ProfileViewController.h"
#import "AppNavigationController.h"
#import "UIColor+AppTintColor.h"

NSString * const kParseApplicationId = @"j4MqR9ASYk601tn3xX3vR8nLUyqcoRqjE0UzCqr7";
NSString * const kParseClientId = @"msAxad6wCjR01uuvzVWYtoMOpbakjgRlwQDTKeD8";
Expand Down Expand Up @@ -75,10 +76,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

[PFFacebookUtils initializeFacebook];

[[UINavigationBar appearance] setTintColor:[UIColor appTintColor]];
[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor appTintColor],
NSForegroundColorAttributeName,
nil]];

BOOL shouldOpenLoginView = NO;

User *user = [User currentUser];

if (user) {

NSLog(@"User name %@", user.name);
Expand Down
2 changes: 2 additions & 0 deletions unnamed/ProfileCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ - (void)awakeFromNib {
// Initialization code
self.backgroundColor = [UIColor appBgColor];
self.profileTitleLabel.textColor = [UIColor appTintColor];
self.profileImageView.isEnabled = NO;
}

- (void)setUser:(User *)user {
_user = user;
self.profileImageView.user = self.user;
self.profileTitleLabel.text = self.user.name;
}
Expand Down
1 change: 1 addition & 0 deletions unnamed/ProfileImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
@interface ProfileImageView : UIImageView
@property (nonatomic, strong) User *user;
@property (nonatomic, strong) id<ProfileImageViewDelegate> delegate;
@property (nonatomic, assign) BOOL isEnabled;

@end
15 changes: 9 additions & 6 deletions unnamed/ProfileImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

@implementation ProfileImageView
- (void) setup {
self.isEnabled = YES;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onImageTap:)];
[self setUserInteractionEnabled:YES];
[self addGestureRecognizer:tapGesture];
Expand Down Expand Up @@ -49,14 +50,16 @@ - (void)drawRect:(CGRect)rect {
*/

- (IBAction)onImageTap:(UITapGestureRecognizer *)sender {
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformMakeScale(1.1, 1.1);
} completion:^(BOOL finished) {
if (self.isEnabled) {
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformMakeScale(1.0, 1.0);
self.transform = CGAffineTransformMakeScale(1.1, 1.1);
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.2 animations:^{
self.transform = CGAffineTransformMakeScale(1.0, 1.0);
}];
}];
}];
[self.delegate profileImageView:self tappedUser:self.user];
[self.delegate profileImageView:self tappedUser:self.user];
}
}

@end
6 changes: 4 additions & 2 deletions unnamed/ProfileViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

#import "ProfileViewController.h"
#import "SurveyViewController.h"
#import "ParseClient.h"
#import "ProfileCell.h"
#import "SurveyViewCell.h"
Expand Down Expand Up @@ -165,8 +166,9 @@ - (void)configureCell:(UITableViewCell *)pCell forRowAtIndexPath:(NSIndexPath *)

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
//SurveyViewController *vc = [[SurveyViewController alloc] init];
//[self.navigationController pushViewController:vc animated:YES];
SurveyViewController *vc = [[SurveyViewController alloc] init];
vc.survey = self.surveys[indexPath.row];
[self.navigationController pushViewController:vc animated:YES];
}


Expand Down
2 changes: 2 additions & 0 deletions unnamed/SurveyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import "DetailAnswerCell.h"
#import "ParseClient.h"
#import "UIColor+AppBgColor.h"
#import "UIColor+AppTintColor.h"

NSString * const AnswerCellNib = @"DetailAnswerCell";
NSString * const QuestionCellNib = @"DetailQuestionCell";
Expand All @@ -32,6 +33,7 @@ @implementation SurveyViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor appBgColor];

// Do any additional setup after loading the view from its nib.
self.tableView.dataSource = self;
self.tableView.delegate = self;
Expand Down

0 comments on commit 48815c6

Please sign in to comment.