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
| ContentManager | |
| * Player Object | |
| * Game Center Hook | |
| * ContentProvider (keyPathCoding or acessors/methods) | |
| * Player.Name | |
| * Player.NetWorth | |
| * Player.StockList | |
| * Player.NetWorthOfStocks | |
| * Player.NetWorthOfStock(stock) |
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)addSubview:(UIView *)view{ | |
| if (view.frame.size.width == 7) { | |
| [super addSubview:view]; | |
| return;//Ignore scrollbar | |
| } | |
| CGSize currentSize = self.contentSize; | |
| currentSize.height += view.frame.size.height; |
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
| NSString * path = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"jpg"]; | |
| UIImage * img = [[UIImage alloc]initWithContentsOfFile:path]; | |
| CGImageRef image = [img CGImage]; | |
| CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(image)); | |
| const unsigned char * buffer = CFDataGetBytePtr(data); |
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
| + (UIImage *)screenShot:(UIView *)aView inRect:(CGRect)aRect | |
| { | |
| // Arbitrarily masks to 40%. Use whatever level you like | |
| UIGraphicsBeginImageContext(aRect.size); | |
| CGContextRef context = UIGraphicsGetCurrentContext(); | |
| CGContextTranslateCTM(context, 0, -aRect.origin.y); | |
| [aView.layer renderInContext:context]; |
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
| NSInteger rows = floorf(self.frame.size.height / (kPostSquareSize + (kPostSquarePadding * 2))); | |
| NSInteger i = 0; | |
| for (CALayer *layer in parentLayer.sublayers) { | |
| CGFloat x = ((i - (i%rows))/rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGFloat y = (i % rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGRect newFrame = CGRectMake(x, y, kPostSquareSize, kPostSquareSize); |
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
| NSInteger rows = floorf(self.frame.size.height / (kPostSquareSize + (kPostSquarePadding * 2))); | |
| NSInteger i = 0; | |
| for (CALayer *layer in parentLayer.sublayers) { | |
| CGFloat x = ((i - (i%rows))/rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGFloat y = (i % rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGRect newFrame = CGRectMake(x, y, kPostSquareSize, kPostSquareSize); |
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
| NSInteger rows = floorf(self.frame.size.height / (kPostSquareSize + (kPostSquarePadding * 2))); | |
| NSInteger i = 0; | |
| for (CALayer *layer in parentLayer.sublayers) { | |
| CGFloat x = ((i - (i%rows))/rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGFloat y = (i % rows) * (kPostSquareSize + kPostSquarePadding); | |
| CGRect newFrame = CGRectMake(x, y, kPostSquareSize, kPostSquareSize); |
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 *someArray; | |
| [someArray sortUsingComparator:^(NSComparator)(ObjectClass *inputA, ObjectClass *inputB){ | |
| //Do compare and return one of the NSComparator values | |
| }]; |
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
| NSArray *sortedArray = [array sortedArrayUsingComparator: ^(id obj1, id obj2) { | |
| if ([obj1 integerValue] > [obj2 integerValue]) { | |
| return (NSComparisonResult)NSOrderedDescending; | |
| } | |
| if ([obj1 integerValue] < [obj2 integerValue]) { | |
| return (NSComparisonResult)NSOrderedAscending; | |
| } | |
| return (NSComparisonResult)NSOrderedSame; |
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)testFocus:(UIBarButtonItem *)sender{ | |
| // [corkboardContentView focusPost:7 completion:^(BOOL finished){}]; | |
| if ([self modalViewController]) { | |
| [self dismissModalViewControllerAnimated:YES]; | |
| }else{ | |