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)handleTapFrom:(UITapGestureRecognizer *)recognizer | |
{ | |
CGPoint point = [recognizer locationInView:self.view]; | |
UIView *tappedView = [self.view hitTest:point withEvent:nil]; | |
if ([tappedView isKindOfClass:[SingleDesignerView class]]) { | |
int row = ((SingleDesignerView*)tappedView).row; | |
NSDictionary *designer = self.designers[row]; | |
NSLog(@"person: %@ %@", designer[@"name"], designer[@"slug"]); | |
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
CATextLayer *textLayer = [CATextLayer layer]; | |
textLayer.backgroundColor = [UIColor whiteColor].CGColor; | |
textLayer.frame = CGRectMake(20, 20, 200, 100); | |
textLayer.contentsScale = [[UIScreen mainScreen] scale]; | |
CTFontRef fontFace = CTFontCreateWithName((__bridge CFStringRef)(@"HelfaSemiBold"), 24.0, NULL); | |
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init]; | |
[attributes setObject:(__bridge id)fontFace forKey:(NSString*)kCTFontAttributeName]; | |
[attributes setObject:[UIColor blackColor] forKey:(NSString*)kCTForegroundColorAttributeName]; | |
NSAttributedString *attrStr = [[NSAttributedString alloc] initWithString:@"Lorem Ipsum" attributes:attributes]; |
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
[UIColor colorWithRed:190/255.f green:190/255.f blue:193/255.f alpha:1.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
if ([MFMailComposeViewController canSendMail]) { | |
NSString *iosVersion = [[UIDevice currentDevice] systemVersion]; | |
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; | |
NSString *appVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; | |
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init]; | |
mailViewController.mailComposeDelegate = self; | |
mailViewController.modalPresentationStyle = UIModalPresentationFormSheet; | |
[mailViewController setToRecipients:@[@"[email protected]"]]; | |
[mailViewController setMessageBody:[NSString stringWithFormat:@"<br/><br/><hr size=1><strong>UTC Chart Information</strong><br/>App Version: %@<br/>iOS Version: %@<hr size=1>", appVersion, iosVersion] isHTML:YES]; |
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
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; | |
[[UIApplication sharedApplication] setnetworkActivityIndicatorVisible:NO]; |
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)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil]; | |
self.window.rootViewController = self.viewController; | |
UIImageView*imageView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Default.png"]]; | |
[[self.viewController view] addSubview:imageView]; | |
[[self.viewController view] bringSubviewToFront:imageView]; | |
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
// Guaranteed to get the characters in the 'illegal' ranges the compiler will complain about. | |
NSMutableAttributedString *attrStr = [NSMutableAttributedString attributedStringWithString:[NSString stringWithFormat:@"%C", (unsigned short)0xe007]]; | |
// Same thing but use a string as the original source of the unicode instead of a literal. | |
unsigned int intValue; | |
NSScanner* scanner = [NSScanner scannerWithString:@"e007"]; | |
[scanner scanHexInt:&intValue]; | |
NSMutableAttributedString *attrStr = [NSMutableAttributedString attributedStringWithString:[NSString stringWithFormat:@"%C", (unsigned short)intValue]]; |
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
.DS_Store | |
*.swp | |
*~ | |
*~.nib | |
*.orig | |
build/ | |
*.pbxuser | |
*.perspective | |
*.perspectivev3 |
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 *typefaceLibrary = [[NSMutableArray alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"typeface-library" ofType:@"plist"]]; |
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
// The easy way. iOS 5.x+ | |
self.webView.scrollView.bounces = NO; | |
// The hard way. | |
// Remove the shadow from behind the webview which appears if the web view | |
// is scrolled past its the top or bottom. | |
// http://stackoverflow.com/a/4167060/99683 | |
for (UIView* subView in [webView subviews]) { | |
if ([subView isKindOfClass:[UIScrollView class]]) { | |
for (UIView* shadowView in [subView subviews]) { |