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
"SHINDIG" = "Shindig"; | |
"PROFILE" = "Profile"; | |
"NEXT" = "Next"; | |
"WELCOME_TEXT" = "Shindig helps you organize events and share their best moments with your friends."; | |
"ENTER_EMAIL" = "Please enter your email address and let's get the party started!"; |
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
[scrollView addSubview:({ | |
UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 44)]; | |
label.text = @"Hello World"; | |
label; | |
})]; |
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
[scrollView addSubview:({ | |
UILabel* label = [[UILabel alloc] initWithFrame:CGRectZero]; | |
label; | |
})]; |
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
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL { | |
if (&NSURLIsExcludedFromBackupKey == nil) { // iOS <= 5.0.1 | |
const char* filePath = [[URL path] fileSystemRepresentation]; | |
const char* attrName = "com.apple.MobileBackup"; | |
u_int8_t attrValue = 1; | |
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0); | |
return result == 0; | |
} else { // iOS >= 5.1 |
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)testWeakAssign | |
{ | |
SingleThreadLock* condition = [[SingleThreadLock alloc]init]; | |
__block AXProductDescription *p1; | |
[AXProductDescription getHeroesWithCompletionHandler:^(NSArray *products, NSError *error) { | |
p1 = [products objectAtIndex:0]; | |
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)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext | |
{ | |
if ([self.delegate respondsToSelector:@selector(setAnimating:)]) | |
[self.delegate setAnimating:YES]; | |
UIView* containerView = [transitionContext containerView]; | |
UIViewController* fromVC = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; | |
UIViewController* toVC = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; | |
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
#import <objc/runtime.h> | |
#import <objc/message.h> | |
__attribute__((constructor)) static void PSPDFFixCollectionViewUpdateItemWhenKeyboardIsDisplayed(void) { | |
@autoreleasepool { | |
if ([UICollectionViewUpdateItem class] == nil) return; // pre-iOS6. | |
if (![UICollectionViewUpdateItem instancesRespondToSelector:@selector(action)]) { | |
IMP updateIMP = imp_implementationWithBlock(^(id _self) {}); | |
Method method = class_getInstanceMethod([UICollectionViewUpdateItem class], @selector(action)); | |
const char *encoding = method_getTypeEncoding(method); | |
if (!class_addMethod([UICollectionViewUpdateItem class], @selector(action), updateIMP, encoding)) { |
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
@interface __NSSpecialDictionary : NSObject | |
@end | |
@implementation __NSSpecialDictionary | |
@end | |
@interface NSDictionary (specialDictionaries) | |
+ (instancetype)specialDictionary; | |
@end |
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
// | |
// FRCTheParentViewController.m | |
// VCDemo | |
// | |
// Created by Matthew Wilkinson on 11/06/2013. | |
// Copyright (c) 2013 FreshCocoa. All rights reserved. | |
// | |
#import "FRCTheParentViewController.h" |
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)swap:(id*)a with:(id*)b | |
{ | |
id c = *a; | |
*a = *b; | |
*b = c; | |
} | |
id a = @1; | |
id b = @2; | |
NewerOlder