Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialxiang mohamed
Courses Plus Student 154 Pointsphoto bomber extra- Display usernames
hello can any one post the codes to display username in the photobombers extra credit
2 Answers
kerdeseverin
9,688 PointsWhat have you tried? or Where are you having issues?
xiang mohamed
Courses Plus Student 154 Pointshi thanks i will post my code , can please help
import "THMetadataView.h"
import "THPhotoController.h"
import <SAMCategories/NSDate+SAMAdditions.h>
@interface THMetadataView () @property (nonatomic) UIImageView *avatarImageView; @property (nonatomic) UIButton *usernameButton; @property (nonatomic) UIButton *timeButton; @property (nonatomic) UIButton *likesButton; @property (nonatomic) UIButton *commentsButton; @end
@implementation THMetadataView
-
(void)setPhoto:(NSDictionary *)photo { _photo = photo;
NSDate *createdAt = [NSDate dateWithTimeIntervalSince1970:[_photo[@"created_time"] doubleValue]]; [self.timeButton setTitle:[createdAt sam_briefTimeInWords] forState:UIControlStateNormal];
UIImage *zero = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[self.photo valueForKeyPath:@"user.profile_picture"]]]]; [self.avatarImageView setImage:zero];
NSDictionary *createdAt = [NSUser :[_photo[@"created_time"] photo]];