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)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { | |
[UIView | |
animateWithDuration:duration | |
animations:^{ | |
self.gridView.contentOffset = CGPointMake(_currentPage * self.view.frame.size.height, 0); | |
} | |
completion:nil]; | |
} |
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)setFullSize:(CGSize)fullSize | |
{ | |
_fullSize = fullSize; | |
[self setNeedsLayout]; | |
} |
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
=respond-to($device) | |
@if $device == handheld | |
@media only screen and (min-width : 320px) | |
@content | |
@if $device == handheld-landscape | |
@media only screen and (min-width : 321px) | |
@content |
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
if(credentials) { | |
ProjectListViewController *projectList = [[ProjectListViewController alloc] init]; | |
projectList.projects = [Portfolio portfolioWithCredentials:credentials].projects; | |
[self.navigationController pushViewController:projectList animated:NO]; | |
} else { | |
// Instantiate LoginViewController and push it. | |
} |
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) animateGridView:(BOOL)animateIn { | |
CAMediaTimingFunction *timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; | |
CABasicAnimation *scaleAnim = [CABasicAnimation animationWithKeyPath:@"transform"]; | |
CABasicAnimation *opacityAnim = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
scaleAnim.timingFunction = opacityAnim.timingFunction = timingFunction; | |
CATransform3D endTransform; | |
CATransform3D fullScale = CATransform3DMakeScale(1, 1, 1); |
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) setCaptionVisible:(BOOL)showCaption { | |
_captionVisible = showCaption; | |
_captionLabel.hidden = !_captionVisible; | |
_captionLabelContainer.hidden = !_captionVisible; | |
} |
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
- (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index { | |
CGSize size = [self sizeForItemsInGMGridView:gridView]; | |
// TODO: should be using dequeReusableCell, but that doesn't appear to be working here... | |
GMGridViewCell *cell = [[GMGridViewCell alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)]; | |
Piece *piece = [self.project.pieces objectAtIndex:index]; | |
PieceView *pieceView = [[PieceView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height) piece:piece]; | |
pieceView.captionVisible = self.showCaption; | |
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
// Create the _captionLabel: | |
_captionLabel = [[UILabel alloc] init]; | |
_captionLabel.textColor = [UIColor colorWithRed:204 green:204 blue:204 alpha:1]; | |
_captionLabel.backgroundColor = [UIColor clearColor]; | |
_captionLabel.text = self.caption; | |
_captionLabel.numberOfLines = 0; | |
_captionLabel.lineBreakMode = UILineBreakModeWordWrap; | |
_captionLabel.font = [UIFont fontWithName:@"Helvetica" size:15]; | |
// Calculate the frame for the caption according to a fixed width and variable size: |
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
/* | |
Distributed under The MIT License: | |
http://opensource.org/licenses/mit-license.php | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to |
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
@implementation RALabel | |
- (void) drawRect:(CGRect)rect | |
{ | |
// Drawing code | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSelectFont (context, [self.font.fontName cStringUsingEncoding:NSASCIIStringEncoding], self.font.pointSize, kCGEncodingMacRoman); | |
CGContextSetCharacterSpacing(context, 1); |