Skip to content
Browse files

Rename profile view controller userID to profileID

Summary: Renamed userID to profileID in FBProfilePictureView

Test Plan: Ran unit tests

Reviewers: jacl, clang

Reviewed By: jacl

CC: bhiller, scottg

Differential Revision: https://phabricator.fb.com/D525702

Task ID: 1192590
  • Loading branch information...
1 parent d24a0a3 commit 1905f74b0996cec498e9846eee6f835f606f3602 @awzy awzy committed Jul 19, 2012
View
6 samples/HelloFacebookSample/HelloFacebookSample/HFViewController.m
@@ -95,9 +95,9 @@ - (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
// id properties of the json response from the server; alternatively we could use
// NSDictionary methods such as objectForKey to get values from the my json object
self.labelFirstName.text = [NSString stringWithFormat:@"Hello %@!", user.first_name];
- // setting the userID property of the FBProfilePictureView instance
+ // setting the profileID property of the FBProfilePictureView instance
// causes the control to fetch and display the profile picture for the user
- self.profilePic.userID = user.id;
+ self.profilePic.profileID = user.id;
self.loggedInUser = user;
}
@@ -106,7 +106,7 @@ - (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
self.buttonPostStatus.enabled = NO;
self.buttonPickFriends.enabled = NO;
- self.profilePic.userID = nil;
+ self.profilePic.profileID = nil;
self.labelFirstName.text = nil;
}
View
12 samples/ProfilePictureSample/ProfilePictureSample/PPViewController.m
@@ -79,28 +79,28 @@ - (IBAction)showJasonProfile:(id)sender {
// FBSample logic
// The following example uses an fbid to indicate which profile
// picture to display, however a vanity name would work as well
- profilePictureView.userID = @"100002768941660";
+ profilePictureView.profileID = @"100002768941660";
}
- (IBAction)showMichaelProfile:(id)sender {
// FBSample logic
// This example and the one after it, in contrast to the prvious one,
// uses a vanity name to indicate which profile picture to display
- profilePictureView.userID = @"michael.marucheck";
+ profilePictureView.profileID = @"michael.marucheck";
}
- (IBAction)showVijayeProfile:(id)sender {
- profilePictureView.userID = @"vijaye";
+ profilePictureView.profileID = @"vijaye";
}
- (IBAction)showRandomProfile:(id)sender {
int index = arc4random() % kNumInterestingIDs;
- profilePictureView.userID = [NSString stringWithCString:interestingIDs[index]
+ profilePictureView.profileID = [NSString stringWithCString:interestingIDs[index]
encoding:NSASCIIStringEncoding];
}
- (IBAction)showNoProfile:(id)sender {
- profilePictureView.userID = nil;
+ profilePictureView.profileID = nil;
}
// Cropping selections
@@ -133,7 +133,7 @@ - (void)viewDidLoad {
[super viewDidLoad];
[self makeViewLarge:nil];
- profilePictureView.userID = @"45963418107"; // Hello world
+ profilePictureView.profileID = @"45963418107"; // Hello world
}
- (void)viewDidUnload {
View
2 samples/Scrumptious/scrumptious/SCViewController.m
@@ -342,7 +342,7 @@ - (void)populateUserDetails {
^(FBRequestConnection *connection, NSDictionary<FBGraphUser> *user, NSError *error) {
if (!error) {
self.userNameLabel.text = user.name;
- self.userProfileImage.userID = [user objectForKey:@"id"];
+ self.userProfileImage.profileID = [user objectForKey:@"id"];
}
}];
}
View
6 samples/SwitchUserSample/SwitchUserSample/SUProfileTableViewCell.m
@@ -99,14 +99,14 @@ - (void) layoutSubviews {
#pragma mark - Properties
- (NSString*)userID {
- return self.profilePic.userID;
+ return self.profilePic.profileID;
}
- (void)setUserID:(NSString *)userID {
// FBSample logic
- // Setting the userID property of the profile picture view causes the view to fetch and display
+ // Setting the profileID property of the profile picture view causes the view to fetch and display
// the profile picture for the given user
- self.profilePic.userID = userID;
+ self.profilePic.profileID = userID;
}
- (NSString*)userName {
View
2 samples/SwitchUserSample/SwitchUserSample/SUUsingViewController.m
@@ -80,7 +80,7 @@ - (void)updateControls {
}
self.nameLabel.text = [NSString stringWithFormat:@"Hello, %@!", user.first_name];
- self.picView.userID = user.id;
+ self.picView.profileID = user.id;
if (user.birthday.length > 0) {
self.birthdayLabel.text = [NSString stringWithFormat:@"Your birthday is: %@", user.birthday];
} else {
View
10 src/FBLoginView.m
@@ -184,8 +184,8 @@ - (void)initialize {
autorelease];
// setup profile picture
- self.profilePicture = [[[FBProfilePictureView alloc] initWithUserID:nil
- pictureCropping:FBProfilePictureCroppingSquare]
+ self.profilePicture = [[[FBProfilePictureView alloc] initWithProfileID:nil
+ pictureCropping:FBProfilePictureCroppingSquare]
autorelease];
// setup profile picture
@@ -268,7 +268,7 @@ - (void)configureViewForStateLoggedIn:(BOOL)isLoggedIn {
a.profileExtent,
a.profileExtent);
- self.profilePicture.userID = nil;
+ self.profilePicture.profileID = nil;
self.user = nil;
}
}
@@ -280,11 +280,11 @@ - (void)fetchMeInfo {
[self.request addRequest:request
completionHandler:^(FBRequestConnection *connection, NSMutableDictionary<FBGraphUser> *result, NSError *error) {
if (result) {
- self.profilePicture.userID = [result objectForKey:@"id"];
+ self.profilePicture.profileID = [result objectForKey:@"id"];
self.user = result;
[self informDelegate:YES];
} else {
- self.profilePicture.userID = nil;
+ self.profilePicture.profileID = nil;
self.user = nil;
}
self.request = nil;
View
6 src/FBProfilePictureView.h
@@ -51,7 +51,7 @@ typedef enum {
@abstract
The Facebook ID of the user, place or object for which a picture should be fetched and displayed.
*/
-@property (copy, nonatomic) NSString* userID;
+@property (copy, nonatomic) NSString* profileID;
/*!
@abstract
@@ -70,10 +70,10 @@ typedef enum {
@abstract
Initializes and returns a profile view object for the given Facebook ID and cropping.
- @param userID The Facebook ID of the user, place or object for which a picture should be fetched and displayed.
+ @param profileID The Facebook ID of the user, place or object for which a picture should be fetched and displayed.
@param pictureCropping The cropping to use for the profile picture.
*/
-- (id)initWithUserID:(NSString*)userID
+- (id)initWithProfileID:(NSString*)profileID
pictureCropping:(FBProfilePictureCropping)pictureCropping;
View
22 src/FBProfilePictureView.m
@@ -34,7 +34,7 @@ - (void)ensureImageViewContentMode;
@implementation FBProfilePictureView
-@synthesize userID = _userID;
+@synthesize profileID = _profileID;
@synthesize pictureCropping = _pictureCropping;
@synthesize connection = _connection;
@synthesize imageView = _imageView;
@@ -43,7 +43,7 @@ @implementation FBProfilePictureView
#pragma mark - Lifecycle
- (void)dealloc {
- [_userID release];
+ [_profileID release];
[_imageView release];
[_connection release];
[_previousImageQueryParamString release];
@@ -60,12 +60,12 @@ - (id)init {
return self;
}
-- (id)initWithUserID:(NSString *)userID
- pictureCropping:(FBProfilePictureCropping)pictureCropping {
+- (id)initWithProfileID:(NSString *)profileID
+ pictureCropping:(FBProfilePictureCropping)pictureCropping {
self = [self init];
if (self) {
self.pictureCropping = pictureCropping;
- self.userID = userID;
+ self.profileID = profileID;
}
return self;
@@ -149,7 +149,7 @@ - (void)refreshImage:(BOOL)forceRefresh {
return;
}
- if (self.userID) {
+ if (self.profileID) {
[self.connection cancel];
@@ -167,7 +167,7 @@ - (void)refreshImage:(BOOL)forceRefresh {
NSString *template = @"%@/%@/picture?%@";
NSString *urlString = [NSString stringWithFormat:template,
FBGraphBasePath,
- self.userID,
+ self.profileID,
newImageQueryParamString];
NSURL *url = [NSURL URLWithString:urlString];
@@ -209,10 +209,10 @@ - (void)ensureImageViewContentMode {
self.imageView.contentMode = contentMode;
}
-- (void)setUserID:(NSString*)userID {
- if (!_userID || ![_userID isEqualToString:userID]) {
- [_userID release];
- _userID = [userID copy];
+- (void)setProfileID:(NSString*)profileID {
+ if (!_profileID || ![_profileID isEqualToString:profileID]) {
+ [_profileID release];
+ _profileID = [profileID copy];
[self refreshImage:YES];
}
}

0 comments on commit 1905f74

Please sign in to comment.
Something went wrong with that request. Please try again.