Skip to content

Instantly share code, notes, and snippets.

View samvermette's full-sized avatar

Sam Vermette samvermette

  • Transit
  • Montréal
View GitHub Profile
@interface Class ()
@property (nonatomic, readonly) NSDateFormatter *dateFormatter;
@end
@implementation Class
@synthesize dateFormatter;
@samvermette
samvermette / SVHTTPRequest.m
Created December 16, 2011 15:49
SVHTTPRequest
[SVHTTPRequest GET:@"http://github.com/api/v2/json/repos/show/samvermette/SVHTTPRequest"
parameters:nil
completion:^(id response, NSError *error) {
NSNumber *watchers = [[response valueForKey:@"repository"] valueForKey:@"watchers"];
NSLog(@"SVHTTPRequest has %@ watchers", watchers);
}];
@samvermette
samvermette / SVStatusHUD.h
Created November 21, 2011 18:44
SVStatusHUD
+ (void)showWithImage:(UIImage*)image;
+ (void)showWithImage:(UIImage*)image status:(NSString*)string;
+ (void)showWithImage:(UIImage*)image status:(NSString*)string duration:(NSTimeInterval)duration;
@samvermette
samvermette / SVHTTPRequest.m
Created September 21, 2011 06:09
SVHTTPRequest
[SVHTTPRequest GET:@"http://api.twitter.com/1/users/show.json"
parameters:[NSDictionary dictionaryWithObject:@"samvermette" forKey:@"screen_name"]
completion:^(NSObject *response) {
NSLog(@"%@", response);
}];
- (void)shareViewController:(SVShareViewController*)controller sendMessage:(NSString*)string forService:(SVShareType)shareType;
- (void)shareViewController:(SVShareViewController*)controller logoutFromService:(SVShareType)shareType;
+ (void)show;
+ (void)showWithStatus:(NSString*)status;
+ (void)showWithStatus:(NSString*)status networkIndicator:(BOOL)show;
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType networkIndicator:(BOOL)show;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType networkIndicator:(BOOL)show;
+ (void)dismiss;
+ (void)dismissWithSuccess:(NSString*)successString;
+ (void)dismissWithSuccess:(NSString*)successString afterDelay:(NSTimeInterval)seconds;
+ (void)dismissWithError:(NSString*)errorString;
+ (void)dismissWithError:(NSString*)errorString afterDelay:(NSTimeInterval)seconds;
- (void)geocoder:(SVGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark;
- (void)geocoder:(SVGeocoder *)geocoder didFailWithError:(NSError *)error;
@samvermette
samvermette / ReverseGeocoder.m
Created February 11, 2011 19:57
Using SMGeocoder's reverse geocoder
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(45.54181, -73.62928);
SVGeocoder *rGeocoderRequest = [[SVGeocoder alloc] initWithCoordinate:coordinate];
[rGeocoderRequest setDelegate:self];
[rGeocoderRequest startAsynchronous];
@samvermette
samvermette / Geocoder.m
Created February 11, 2011 19:48
Using SMGeocoder's geocoder
NSString *addressString = @"3245 St-Denis, Montreal"
SVGeocoder *geocodeRequest = [[SVGeocoder alloc] initWithAddress:addressString];
[geocodeRequest setDelegate:self];
[geocodeRequest startAsynchronous];