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
if(![managedObjectContext save:&error]) { | |
NSLog(@"Failed to save to data store: %@", [error localizedDescription]); | |
NSArray* detailedErrors = [[error userInfo] objectForKey:NSDetailedErrorsKey]; | |
if(detailedErrors != nil && [detailedErrors count] > 0) { | |
for(NSError* detailedError in detailedErrors) { | |
NSLog(@" DetailedError: %@", [detailedError userInfo]); | |
} | |
} | |
else { | |
NSLog(@" %@", [error userInfo]); |
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
-(IBAction)didSwipeLeftInCell:(id)sender { | |
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; | |
[UIView animateWithDuration:1.0 animations:^{ | |
[_topView setFrame:CGRectMake(-10, 0, 320, 80)]; | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.15 animations:^{ | |
[_topView setFrame:CGRectMake(0, 0, 320, 80)]; | |
}]; | |
}]; | |
} |
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
-(IBAction)didSwipeLeftInCell:(id)sender { | |
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; | |
[UIView animateWithDuration:1.0 animations:^{ | |
[_topView setFrame:CGRectMake(-10, 0, 320, 80)]; | |
} completion:^(BOOL finished) { | |
[UIView animateWithDuration:0.15 animations:^{ | |
[_topView setFrame:CGRectMake(0, 0, 320, 80)]; | |
}]; | |
}]; | |
} |
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
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier | |
{ | |
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; | |
if (self) { | |
// Initialization code | |
// Create the top view | |
_topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 80)]; | |
[_topView setBackgroundColor:[UIColor whiteColor]]; | |
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)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { | |
CGFloat contentOffsetY = scrollView.contentOffset.y; | |
if (contentOffsetY < -60.0) { | |
[self displayActivitySpinner]; | |
} | |
} |
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)takeSimulatorSafePhotoWithPopoverFrame:(GCRect)popoverFrame { | |
// Prerequisites: | |
// | |
// Class requires two properties to be defined: | |
// | |
// @property (nonatomic, strong) UIImagePickerController *imagePicker; | |
// @property (nonatomic) BOOL usingPopover; | |
// Load the imagePicker |
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
# Mac OS X | |
*.DS_Store | |
# Xcode | |
*.pbxuser | |
*.mode1v3 | |
*.mode2v3 | |
*.perspectivev3 | |
*.xcuserstate | |
project.xcworkspace/ |
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
Thonburi | |
"Thonburi-Bold", | |
Thonburi | |
Snell Roundhand | |
"SnellRoundhand-Bold", | |
"SnellRoundhand-Black", | |
SnellRoundhand | |
Academy Engraved LET |
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
Add gesture recognizer to UIWebView: | |
UITapGestureRecognizer *tapCatcher = [[UITapGestureRecognizer alloc] init]; | |
[tapCatcher setNumberOfTapsRequired:1]; | |
[tapCatcher setNumberOfTouchesRequired:1]; | |
[tapCatcher setDelegate:self]; | |
[tapCatcher addTarget:self action:@selector(didTapOnView)]; | |
[self.webView addGestureRecognizer:tapCatcher]; |
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
# build data file that is included in the source | |
# so we can automatically report Git repo information | |
# in the application. | |
cd ${PROJECT_DIR} | |
gitDataFile="gitDataAutoGenerated.h" | |
buildDate=`date "+%F %H:%M:%S"` | |
currentBranch=`git rev-parse --abbrev-ref HEAD` | |
lastCommitHash=`git log --pretty=format:"%h" -1` | |
lastCommitDate=`git log --pretty=format:"%ad" --date=short -1` |
OlderNewer