WWDC 2007 2008 2009 2010 2011 2012 2013 2014 2015
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
struct Point: Hashable, CustomStringConvertible { | |
let x: Int; let y: Int | |
init(x: Int, y: Int) { | |
self.x = x | |
self.y = y | |
} | |
init(_ str: String) { | |
// x represents distance to the right and y represents distance down. |
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
class Path { | |
let point: Point | |
let previousPath: Path? | |
let length: Int | |
init(to point: Point, previousPath path: Path? = nil) { | |
self.point = point | |
self.length = 1 + (path?.length ?? 0) | |
self.previousPath = path | |
} |
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
#import <CoreTelephony/CTCarrier.h> | |
#import <CoreTelephony/CTTelephonyNetworkInfo.h> | |
@class CTCarrier; | |
@interface ANCarrierMeta: NSObject | |
@property (nonatomic, copy, readonly) NSString *name; | |
@property (nonatomic, copy, readonly) NSString *countryCode; | |
@property (nonatomic, copy, readonly) NSString *networkCode; | |
- (instancetype)initWith:(NSString *)name |
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
#import "SPVMainViewController.h" | |
@implementation SPVMainViewController | |
{ | |
UIView *_weightView; | |
UIPanGestureRecognizer *_recog; | |
} | |
- (void)viewDidLoad | |
{ |
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
extension UIDynamicAnimator { | |
func _setDebugAnimationSpeed(_ speed: CGFloat) { | |
self.perform(NSSelectorFromString("setDebugAnimationSpeed:"), with: speed) | |
} | |
func _setDebugEnabled(_ enabled: Bool) { | |
self.perform(NSSelectorFromString("setDebugEnabled:"), with: enabled) | |
} | |
func _setDebugFrameInterval(_ interval: Int) { |
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
func p_setupTextLayer(text: String) -> CAShapeLayer { | |
var letters = CGPathCreateMutable() | |
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil) | |
let attrs = [kCTFontAttributeName: font] | |
var attrString = NSAttributedString(string: text, attributes: attrs) | |
let line = CTLineCreateWithAttributedString(attrString) | |
let runArray = CTLineGetGlyphRuns(line) | |
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
extension CGFloat { | |
static var eps: CGFloat { | |
if CGFLOAT_IS_DOUBLE == 1 { | |
return CGFloat(DBL_EPSILON) | |
} else { | |
return CGFloat(FLT_EPSILON) | |
} | |
} | |
} |
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
#import <objc/runtime.h> | |
void DumpObjcMethods(Class clz) { | |
unsigned int count = 0; | |
Method *methods = class_copyMethodList(clz, &count); | |
printf("Found %d methods on '%s'\n", count, class_getName(clz)); | |
for (unsigned int i = 0; i < count; i++) { |
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
ACTION = build | |
AD_HOC_CODE_SIGNING_ALLOWED = NO | |
ALTERNATE_GROUP = staff | |
ALTERNATE_MODE = u+w,go-w,a+rX | |
ALTERNATE_OWNER = grantdavis | |
ALWAYS_SEARCH_USER_PATHS = NO | |
ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
APPLE_INTERNAL_DIR = /AppleInternal | |
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
NewerOlder