This file contains hidden or 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)setupDecimalPadDone | |
{ | |
self.keyboardShownObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillShowNotification | |
object:nil | |
queue:[NSOperationQueue mainQueue] | |
usingBlock:^(NSNotification *note) { | |
self.goButton = [UIButton buttonWithType:UIButtonTypeCustom]; | |
[[[[UIApplication sharedApplication] windows] lastObject] addSubview:self.goButton]; | |
This file contains hidden or 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
NSMutableArray *objects = [@[] mutableCopy]; | |
NSObject *someObject = [NSObject new]; | |
objects[objects.count] = object; |
This file contains hidden or 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
/* | |
* SenTestingKit does not wait for blocks to finish by default so your test would simply complete | |
* as successful. You need to use a semaphore and keep the run loop going in order for the test | |
* to properly run. | |
*/ | |
- (void)testGetSpots { | |
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); | |
CLLocation location = [[CLLocation alloc] initWithLatitude:70.0 longitude:50.0]; | |
[Spot spotsWithURLString:@"/spots" near:location parameters:[NSDictionary dictionaryWithObject:@"128" forKey:@"per_page"] block:^(NSArray *records) { | |
//sample assert |
This file contains hidden or 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
#define screenHeight() ([UIScreen mainScreen].bounds.size.height) | |
#define isPhoneFive() (screenHeight() == 568) | |
#define isOS6() ([[[UIDevice currentDevice] systemVersion]intValue] > 5.2) | |
#define UIInterfaceIdiomIsPad() (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define UIColorFromRGB(rgbValue) [UIColor \ | |
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ |