Skip to content

Instantly share code, notes, and snippets.

View moflo's full-sized avatar
🎯
Focusing

moflo moflo

🎯
Focusing
View GitHub Profile
@moflo
moflo / Google OAuth2 iOS Library with LinkedIn and Twitter.m
Created May 14, 2011 16:27
Using the Google iOS OAuth2 library for both Twitter and LinkedIn
- (void)signIn:(int)socialNetworkType {
//! Method to launch authorization modal dialog for Twitter or LinkedIn
NSURL *requestURL;
NSURL *authorizeURL;
NSURL *accessURL;
NSString *scope;
if (socialNetworkType == kSignupSocialLinkedIn) {
// LinkedIn OAuth token request URLs
@moflo
moflo / LinkedInTableCellMethod.m
Created May 14, 2011 15:21
Method for creating a UITableViewCell stuffed with LinkedIn user data
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ToolAppImportContactCell *cell = (ToolAppImportContactCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
// Grab LinkedIn User Data
// LinkedInUser is a custom object container for name, LinkedInID and avatar URL
LinkedInUser *person = [self.list objectAtIndex:indexPath.row];
// Generate NSString to display in cell
cell.nameLabel.text = [NSString stringWithFormat:@"%@ %@",(person.name?person.name:@""),(person.name_last?person.name_last:@"")];
// Display the LinkedIn User's status (ie., location)
@moflo
moflo / gist:770613
Created January 8, 2011 06:29
dismissView.m
- (void) dismissView {
//! Dismiss the veiw depending on the context, whether from the Signin view or Invitation view
if ([[UserManager sharedUserManager] getUserState] <= kFFUserStateUnregistered) { // was == kFFUserStateFirstTimeUser
fieldforcebetaAppDelegate *myApp = (fieldforcebetaAppDelegate *)[UIApplication sharedApplication].delegate;
myApp.tabBarController.selectedIndex = [myApp getTabIndexForTag:6];
[[NSNotificationCenter defaultCenter] postNotificationName:@"launchSequenceCompleted" object:self userInfo:nil];
}