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
- (void)drawRect:(CGRect)rect { | |
if (self.text && [self.text length] > 0) { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[self.textColor set]; | |
[self.text drawInRect:rect withFont:self.font]; | |
CGContextSetStrokeColorWithColor(context, self.textColor.CGColor); | |
CGContextSetLineWidth(context, 1.0f); | |
CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMidY(rect)); | |
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMidY(rect)); |
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
#ifdef __OBJC__ | |
#ifdef DEBUG | |
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
# define DLog(...) | |
#endif | |
// ALog always displays output regardless of the DEBUG setting | |
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#endif |
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 UIApplication (NetworkActivityIndicator) | |
- (void)increaseActiveRequests; | |
- (void)decreaseActiveRequests; | |
@end | |
@implementation UIApplication (NetworkActivityIndicator) | |
static int counter = 0; |
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
+ (NSString *)UDIDString { | |
NSString *udid = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, | |
(CFStringRef)[[UIDevice currentDevice] uniqueIdentifier], | |
NULL, | |
(CFStringRef)@" !*'();:@&=+$,/?%#[]", | |
kCFStringEncodingUTF8); | |
return [udid autorelease]; | |
} |
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
ABAddressBookRef addressBook = ABAddressBookCreate(); | |
NSArray *allAddressBookPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(addressBook); | |
for (int i = 0; i < [allAddressBookPeople count]; ++i) { | |
ABRecordRef record = [allAddressBookPeople objectAtIndex:i]; | |
NSData *imageData = nil; | |
if (ABPersonCopyImageDataWithFormat != NULL) { | |
imageData = (NSData *)ABPersonCopyImageDataWithFormat(record, kABPersonImageFormatThumbnail); | |
} else { | |
imageData = (NSData *)ABPersonCopyImageData(record); | |
} |
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
[tableView setContentInset:UIEdgeInsetsMake(1, 0, 0, 0)]; // set content inset so the first separator is displayed |
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
@synthesize selectedIndexPath; | |
@synthesize defaultRowHeight; | |
@synthesize optionRowHeight; | |
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ | |
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; | |
if (self) { | |
self.optionRowHeight = 40; | |
} |
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
// | |
// UIImage+RoundedResize.h | |
// | |
// Created by Amudi SEBASTIAN | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIImage (RoundedResize) |
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
Pod::Spec.new do |s| | |
s.name = "MPFlipViewController" | |
s.version = "0.0.2" | |
s.summary = "Container view controller (iOS 5 containment API) that navigates between child view controllers via touch gestures and page-flip animations." | |
s.description = "A custom container view controller following the iOS 5 containment API that navigates between child view controllers via touch gestures and page-flip animations." | |
s.homepage = "http://markpospesel.com/2012/07/28/mpflipviewcontroller/" | |
s.license = { :type => 'Modified BSD License', :file => 'Source Code License.rtf' } | |
s.author = "Mark Pospesel" | |
s.source = { :git => "https://github.com/amudi/MPFlipViewController.git", :commit => "815705bb46ee412b8d0d380c7eb8f07710b9b926" } | |
s.platform = :ios, '5.0' |
OlderNewer