git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/// Appends a value to an array within a dictionary without triggering a copy. | |
/// Necessary in Swift 3 but expected to be obsoleted as the way inout works | |
/// will be changed (eliminating the need for the write-back copy) | |
func append<K, V>(value: V, toKey key: K, in dict: inout [K : Array<V>]) { | |
var a: [V]? = [] | |
swap(&a, &dict[key]) | |
a = a ?? [] | |
a!.append(value) | |
swap(&a, &dict[key]) |
@import WatchKit; | |
@interface CachingInterfaceController : WKInterfaceController | |
- (void)updateLabel:(WKInterfaceLabel *)label withString:(NSString *)string; | |
- (void)updateLabel:(WKInterfaceLabel *)label asHidden:(BOOL)hidden; | |
- (void)updateImage:(WKInterfaceImage *)image withImageNamed:(NSString *)imageName; | |
- (void)updateImage:(WKInterfaceImage *)image withBaseNameForAnimation:(NSString *)baseName withRange:(NSRange)range duration:(NSTimeInterval)duration repeatCount:(NSInteger)repeatCount; | |
- (NSString *)currentImageNameForImage:(WKInterfaceImage *)image; |
@import UIKit; | |
IB_DESIGNABLE @interface CBCImageView : UIImageView | |
@end | |
@implementation CBCImageView | |
- (void)awakeFromNib | |
{ |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
#! /bin/sh | |
# usage: <shellscript> [--osx] typename | |
if [ "$1" = "--osx" ] ; then | |
echo ":print_module $2" | xcrun swift -deprecated-integrated-repl | |
else | |
sdk_path=$(echo `xcrun --show-sdk-path` | sed 's#MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk#iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk#') | |
echo ":print_module $1" | xcrun swift -deprecated-integrated-repl -sdk "$sdk_path" | |
fi |
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
#import "typestring.h" | |
// clang -g -fobjc-arc -Wall -framework Foundation -o runtime typestring.m runtime.m | |
// Runtime reference, at least until Apple breaks the link | |
// http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html |
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit. | |
#import <objc/runtime.h> | |
#import <objc/message.h> |
#!/usr/sbin/dtrace -s | |
/* Run like: | |
% sudo csh | |
# ./spy.d $PROCESS_ID [$INTERESTING_PROBEPROV] | |
Prints a line of dashes every 5 seconds to delineate different experiments. | |
*/ | |
#pragma D option quiet |
#!/usr/sbin/dtrace -s | |
/* Run like: | |
% sudo csh | |
# ./spy.d $PROCESS_ID [$INTERESTING_PROBEPROV] | |
Prints a line of dashes every 5 seconds to delineate different experiments. | |
*/ | |
#pragma D option quiet |