View gist:5682765
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SomeViewController : UIViewController | |
@end | |
@implementation SomeViewController | |
- (IBAction)show:(id)sender | |
{ | |
UIImagePickerController *pickerController = [UIImagePickerController new]; | |
[pickerController setDelegate:(id)self]; |
View gist:5490060
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *urlStuff = @{ | |
@"absoluteString" : URL.absoluteString ? URL.absoluteString : @"nil", | |
@"relativeString" : URL.relativeString ? URL.relativeString : @"nil", | |
@"scheme" : URL.scheme ? URL.scheme : @"nil", | |
@"resourceSpecifier" : URL.resourceSpecifier ? URL.resourceSpecifier : @"nil", | |
@"host" : URL.host ? URL.host : @"nil", | |
@"port" : URL.port ? URL.port : @"nil", | |
@"user" : URL.user ? URL.user : @"nil", | |
@"password" : URL.password ? URL.password : @"nil", | |
@"path" : URL.path ? URL.path : @"nil", |
View listFonts.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames = [[NSArray alloc] initWithArray: | |
[UIFont fontNamesForFamilyName: | |
[familyNames objectAtIndex:indFamily]]]; |
View NSString+Crypto.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <CommonCrypto/CommonHMAC.h> | |
@interface NSString (Crypto) | |
- (NSString *)md5; | |
+ (NSString *)encodeBase64WithString:(NSString *)strData; | |
+ (NSString *)encodeBase64WithData:(NSData *)objData; | |
+ (NSData *)decodeBase64WithString:(NSString *)strBase64; | |
- (NSString*)sha1; |
View DPAnnotationView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <MapKit/MapKit.h> | |
@interface DPAnnotationView : MKAnnotationView | |
@property (nonatomic, assign) MKMapView *mapView; | |
@end |
View gist:3734823
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)showWalkingDirections:(id)sender { | |
if ([self.parkingDetails.mapItem respondsToSelector:@selector(openInMapsWithLaunchOptions:)]) { | |
NSDictionary *launchOptions = @{ | |
MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeWalking, | |
MKLaunchOptionsMapTypeKey : [NSNumber numberWithInt:MKMapTypeStandard] | |
}; | |
[self.parkingDetails.mapItem openInMapsWithLaunchOptions:launchOptions]; | |
} else { | |
NSString *mapURL = @"http://maps.google.com/maps?"; |
View DJPAppDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface DJPAppDelegate : UIResponder <UIApplicationDelegate, UIAppearanceContainer> | |
@end |
View UILabel+GetLines.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UILabel (GetLines) | |
- (NSArray*) lines; | |
@end |
View UILabel+dynamicSizeMe.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UILabel (dynamicSizeMe) | |
-(float)resizeToFit; | |
-(float)expectedHeight; | |
@end |
View DJPWebView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "DJPWebViewDelegate.h" | |
#import "DJPWebViewContent.h" | |
@interface DJPWebView : UIWebView { | |
DJPWebViewDelegate* delegateObject; | |
DJPWebViewContent* content; | |
} | |
@property(nonatomic, retain)DJPWebViewContent* content; |
NewerOlder