Skip to content

Instantly share code, notes, and snippets.

@SPopenko
SPopenko / How to use bar
Created September 25, 2012 14:17
Package up Action Bar Implementation
#import "SZPathBar.h"
//Put this on init section
if(self.sszBar == nil)
{
self.sszBar = [[[SZPathBar alloc] initWithButtonsMask: SZCommentsButtonMask|SZShareButtonMask|SZLikeButtonMask
parentController: viewController
entity: self.currentEntity]autorelease];
@SPopenko
SPopenko / Check like button state
Created September 25, 2012 13:17
Instructions for devs to create their own ActionBar Implemntation
[SZLikeUtils isLiked:entity
success:^(BOOL isLiked){
[self setEntityLiked: isLiked]; //update button icon & internal state
}
failure:^(NSError *error){
NSLog(@"Failed detect like: %@", [error localizedDescription]);
[self setEntityLiked: NO]; //update button icon & internal state
}];
@SPopenko
SPopenko / gist:3293745
Created August 8, 2012 09:24
Add company button
AwesomeMenuItem *amButton = [[[AwesomeMenuItem alloc] initWithImage:[UIImage imageNamed:@"bg-menuitem.png"]
highlightedImage:[UIImage imageNamed:@"bg-menuitem-highlighted.png"]
ContentImage:[UIImage imageNamed:@"AM.png"]
highlightedContentImage:nil] autorelease];
[bar addButton:amButton handler:^(){
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"About page" message:@"This is about page" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}];
@SPopenko
SPopenko / gist:3293696
Created August 8, 2012 09:15
SSZ path control integration
self.bar = [[[SZPathBar alloc] initWithButtonsMask: SZProfileButtonMask|SZCommentsButtonMask|SZShareButtonMask|SZLikeButtonMask
parentController: self
entity: [SZEntity entityWithKey:@"http://www.google.com" name:@"Google"]] autorelease];
bar.menu.rotateAngle = -M_PI_2;
bar.menu.menuWholeAngle = 110 * M_PI / 180;
bar.menu.startPoint = self.view.center;
[self.view addSubview:bar.menu];
@SPopenko
SPopenko / CommentUI.m
Created September 20, 2011 14:12 — forked from FawadHa1der/CommentUI.m
SocializeSDK iOS Code Snippets part 2
//create a URL for your entity. This must be a unique URL but can return a 404
NSString *entityUrlString = @"http://www.example.com/object/1234";
// Allocate memory for the instance
SocializeCommentsTableViewController* commentsController = [[[SocializeCommentsTableViewController alloc] initWithNibName:@"SocializeCommentsTableViewController" bundle:nil entryUrlString:entityUrlString] autorelease];
[self.navigationController pushViewController:commentsController animated:YES];
@SPopenko
SPopenko / Authentication.m
Created September 20, 2011 14:11 — forked from FawadHa1der/Authentication.m
SocializeSDK iOS Code Snippets
#import <Socialize-iOS/Socialize.h>
// invoke the call
[socialize authenticateWithApiKey:@"YourApiKey" apiSecret:@"YourApiSecret"];
#pragma mark SocializeServiceDelegate implementation
// implement the delegate
-(void)didAuthenticate:(id<SocializeUser>)user {
NSLog(@"Authenticated");
}