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
- (BOOL)removeCompletedRows | |
{ | |
NSMutableArray *dropsToRemove = [[NSMutableArary alloc] init]; | |
for (CGFloat y = self.gameView.bounds.size.height-DROP_SIZE.height/2; y > 0; y -= DROP_SIZE.height) | |
{ | |
BOOL rowIsComplete = YES; | |
NSMutableArray *dropsFound = [[NSMutableArray allc] init]; | |
for (CGFloat x = DROP_SIZE.width/2; x <- self.gameView.bounds.size.witdh-DROP_SIZE.width/2; x += DROP_SIZE.width) | |
{ | |
UIView *hitView = [self.gameView hitTest:(CGPointMake(x, y) withEvent:NULL]; |
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
layer.shouldRasterize = true | |
layer.rasterizationScale = [UIScreen mainScreen].scale |
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)viewDidLoad { | |
[super viewDidLoad]; | |
self.array = [self configureArray]; | |
for (int i = 0; i < self.array.count; i++) { | |
CGRect frame; | |
frame.origin.x = self.view.frame.size.width * i; | |
frame.origin.y = 0; |
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
#import "ContainerViewController.h" | |
#define SegueIdentifierFirst @"embedFirst" | |
#define SegueIdentifierSecond @"embedSecond" | |
@interface ContainerViewController () | |
@property (strong, nonatomic) NSString *currentSegueIdentifier; | |
@end | |
@implementation ContainerViewController |
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)viewDidLoad { | |
[super viewDidLoad]; | |
[self addGesture:self.view]; | |
} | |
- (void)addGesture:(UIView *)aView { | |
UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didDetectClick:)]; | |
[aView addGestureRecognizer:gesture]; | |
for (UIView *subView in aView.subviews) { |
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
UITableViewCell *cell = sender; | |
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell]; |
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
// get global queue | |
dispatch_queue_t globalQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); | |
// create serial background queue | |
dispatch_queue_t newQueue = dispatch_queue_create("com.domain.app.queuename", 0); | |
// dispatch asynchronously to a specific thread | |
dispatch_async(queueName, ^{ | |
// the slow stuff to be done in the background | |
}); |
OlderNewer