Professional Documents
Culture Documents
//
//
//
//
//
//
//
4/2/15, 8:59 PM
AppDelegate.m
Friend-Duster
Created by Bryan Crampton on 3/26/15.
Copyright (c) 2015 Orange Slide Apps, Inc. All rights reserved.
#import "UnfriendView.h"
#import <QuartzCore/QuartzCore.h>
@implementation UnfriendView
static UIImage *_defaultImage;
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.layer.masksToBounds = YES;
self.layer.cornerRadius = 8.0f;
self.layer.borderColor = [UIColor lightGrayColor].CGColor;
self.layer.borderWidth = 2.0f;
self.backgroundColor = [UIColor whiteColor];
profilePicImageView = [[UIImageView alloc] init];
nameLabel = [[UILabel alloc] init];
unfriendButton = [[UIButton alloc] init];
unfollowButton = [[UIButton alloc] init];
keepButton = [[UIButton alloc] init];
[self
[self
[self
[self
[self
addSubview:profilePicImageView];
addSubview:nameLabel];
addSubview:unfriendButton];
addSubview:unfollowButton];
addSubview:keepButton];
[self customizeSubviews];
}
return self;
}
- (void)customizeSubviews {
profilePicImageView.contentMode = UIViewContentModeScaleAspectFill;
nameLabel.font = [UIFont defaultBoldFont];
unfriendButton.backgroundColor = [UIColor redColor];
unfollowButton.backgroundColor = [UIColor yellowColor];
keepButton.backgroundColor = [UIColor greenColor];
unfriendButton.titleLabel.font = [UIFont defaultBoldFont];
unfollowButton.titleLabel.font = [UIFont defaultBoldFont];
keepButton.titleLabel.font = [UIFont defaultBoldFont];
Page 1 of 3
UnfriendView.m
4/2/15, 8:59 PM
UnfriendView.m
4/2/15, 8:59 PM
}
#pragma mark - Instance Methods
- (void)setProfilePicURL:(NSURL *)profilePicURL {
if (!_defaultImage) {
_defaultImage = [UIImage imageNamed:@"default-photo.jpg"];
}
[profilePicImageView sd_setImageWithURL:profilePicURL placeholderImage:
_defaultImage];
}
- (void)setName:(NSString *)name {
nameLabel.text = name;
}
@end
Page 3 of 3